Everything displays correctly:

var arr = [[0, '- Не выбрано -'], [1, 'Значение 1']]; select._new('test', {width: 238}, arr); 

Link to jsfiddle - http://jsfiddle.net/UcLgS

Displays incorrectly, you need to somehow turn the text into an array :

 <div id="arr" style="display: none">[0, '- Не выбрано -'], [1, 'Значение 1']</div> var arr = [$('#arr').text()]; select._new('test', {width: 238}, arr); 

Link to jsfiddle - http://jsfiddle.net/UcLgS/2/

You need to click on the rectangle itself and there should be a list. Links to jsfiddle are attached for comparison.

    1 answer 1

    Result in valid JSON format:

     <div id="arr" style="display: none">[["0", "- Не выбрано -"], ["1", "Значение 1"]]</div> 

    And then:

     var arr = JSON.parse($('#arr').text()); 

    PS json2.min.js

    • @Yura Ivanov, you know what I tell you, you are a genius! Repeatedly save your answers. Only instead of the library with json parsing, in jquery there is $ .parseJSON (text) ;. Thank you very much! - ModaL
    • 2
      json2 is faster. jquery.parseJSON tries to use the browser's native parser and if it is not available, then the eval analog is used. discussion on SO - Yura Ivanov