i´m using 1.0.1
here´s part of my code:
for (i=0;i<data_schools.length;i++) {
var option = $.OPTION({ value:data_schools[i][0] }, data_schools[i]
[0] );
$('#selectLocation').append(option);
}
<select name="location" class="vSelectField" id="selectLocation">
<option value="" selected>bitte auswählen</option>
</select>
data_schools is a json_list, btw.
Am 10.10.2006 um 23:39 schrieb Rey Bango:
> Patrick,
>
> I tried using this plugin but it didn't seem to work with v1.0.1.
> Which
> version of JQuery are you using?
>
> Rey
>
> patrickk wrote:
>> I´m using the plugin for "DOM creation" to accomplish that.
>> see
>> http://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype
>>
>> patrick
>>
>>
>> Am 10.10.2006 um 22:49 schrieb Galen Palmer:
>>
>>
>>> Hi All,
>>>
>>> I'm new to jquery but like what I see so far.
>>>
>>> I have an array of strings that I'd like to add to a <select>
>>> element
>>> as <option> elements.
>>>
>>> HTML:
>>>
>>> <select id="routeSelect">
>>> </select>
>>>
>>> JavaScript:
>>>
>>> for(var i = 0; i < routes.length; ++i) {
>>> $("#routeSelect").append("<option value=\""
>>> + routes[i] +"\">"+ routes[i] +"</option>");
>>> }
>>>
>>> The above code appears to just append the text to the select element
>>> without creating the child option elements. Viewing the generated
>>> source (in Web Developer in Firefox) shows htm like: <select
>>> id="routeSelect">abcdef</select>
>>>
>>> However, the following code (more "old school") seems to work fine.
>>>
>>> var routeSelect = $("#routeSelect").get(0);
>>> for(var i = 0; i < routes.length; ++i) {
>>>
>>> routeSelect.options[i + 1] = new Option(
>>> routes[i],
>>> routes[i]);
>>> }
>>>
>>> I'm using firefox under Mac OSX though it looks like the same
>>> behavior
>>> under safari and opera.
>>>
>>> _______________________________________________
>>> jQuery mailing list
>>> [email protected]
>>> http://jquery.com/discuss/
>>
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> [email protected]
>> http://jquery.com/discuss/
>>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/