[jQuery] $().load didn't works ini IE6
I need help to make the following code works in IE :
document.writeln("<select name=\""+name+"\"
id=\""+name+"\""+((multiple!=null)?" "+multiple:"")+">");
var tablename = "some_table";
$("#"+name).load("table_query.php", {table: tablename});
document.writeln("<\/select>");
Script table_query.php return <option> elements. This code work well
in Firefox, but in IE, the select had no option.
I tried to change table_query.php result to xml, and use following code :
document.writeln("<select name=\""+name+"\"
id=\""+name+"\""+((multiple!=null)?" "+multiple:"")+">");
var tablename = "some_table";
var myRandom = parseInt(Math.random()*99999999);
$.get("table_query.php", {table: tablename, rand: myRandom},
function (r, type) {
//alert (xml);
//remove previous element
$("#"+name).empty();
var options = r.getElementsByTagName("option");
var names = r.getElementsByTagName("name");
var name = names[0].getAttribute("value");
for (var i=0; i<options.length; i++) {
var value = options[i].getAttribute("value");
var label = options[i].firstChild.nodeValue;
var newOptions = new Option(label, value);
$("#"+name).append(newOptions);
}
});
document.writeln("<\/select>");
works with Ff, but still don't work with IE. D*** IE :(
--
Donny Kurnia
http://hantulab.multiply.com/
http://hantulab.blogspot.com/
-------------------------------------------
At times the world can seem an unfriendly and sinister place. But
believe us when we say there is much more good in it than bad. And
what might seem to be a series of unfortunate events, may in fact, be
the first steps of a journey.
-- A Series of Unfortunate Events
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/