ravinesolutions
asked on
Javascript change dropdown value to attribute of responseXML AJAX
I need to change the value of a dropdown to the value that comes from an AJAX called PHP script.
I try this two ways and both ways work in FF but not IE:
I try this two ways and both ways work in FF but not IE:
xmlDoc = xmlHttp.responseXML;
alert(xmlHttp.responseText);
var line = xmlDoc.getElementsByTagName("line")[0];
//document.getElementById('o_contact_type1').value = line.attributes['type'].value;
var type = line.attributes['type'];
var o_contact_type1 = document.getElementById('o_contact_type1');
o_contact_type1.options[o_contact_type1.options.length] = new Option(type.text,type.value);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
var title = line.attributes[1].nodeVal
xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "secured/get_ids.php?title
xmlHttp.send(null);
var xmlDoc2 = xmlHttp.responseXML;
var element2 = xmlDoc2.getElementsByTagNa
var line2 = element2.getElementsByTagN
alert(line2.attributes[0].
Please suggest why this throws up an error in IE7.
Cheers