Hi,
I'm pulling my hair for some time with this problem today. Will greatly appreciate if some one could provide me a solution.
I'm using ajax to get a list of categories to be populated in a dropdown.
My main code is below.
Problem is in the next section of code.
This works fine in FF, Opera, Safari, Chrome showing the dependable dropdowns, but not in IE. the row is empty when checked in ie.
when i do an alert
i get zero as length. i have no clue why the length becomes zero. IE shows no error message also.
the xml returned by the php script is given below.
please give me some advice
I'm pulling my hair for some time with this problem today. Will greatly appreciate if some one could provide me a solution.
I'm using ajax to get a list of categories to be populated in a dropdown.
My main code is below.
Code:
function makeRequest() { if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); else if (window.XMLHttpRequest) return new XMLHttpRequest(); else { alert("Your browser does not support AJAX."); return null; } } var http = makeRequest(); function sendRequest(url, callbackfn) { http.open('get', url); http.onreadystatechange = callbackfn; http.send( null ); }
Code:
var response = http.responseXML; var row = response.getElementsByTagName('topic');
when i do an alert
Code:
alert(row.length);
the xml returned by the php script is given below.
Code:
<?xml version="1.0"?> <topics> <topic id="1" title="Arithmetic"/> <topic id="2" title="Algebra"/> <topic id="3" title="Geometry"/> <topic id="4" title="Word Problems"/> <topic id="5" title="Miscellaneous"/> </topics>
Comment