When I'm populating a select element from the results of an Ajax call
I'm having trouble using the Element constructor.
If I create the element like this:
var oOption = new Element('option', {'text':tag[i].firstChild.data});
It works in IE7 but not in Firefox3. If I create it like this:
var oOption = new Element('option').update(tag[i].firstChild.data);
It works in Firefox3 but not in IE7. This code, not using Prototype,
works in both:
var oOption = document.createElement('OPTION');
oOption.text = tag[i].firstChild.data;
By 'works' I mean the appropriate option element is added to the
select box when I use the standard .add() method:
try { //DOM standard
selWKTYP.add(oOption, null);
}
catch(ex) { //IE only
selWKTYP.add(oOption);
}
Am I doing something wrong?
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---