View Single Post
Old 10-11-2012, 01:36 AM   PM User | #2
Jimmaay
New to the CF scene

 
Join Date: Oct 2012
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Jimmaay is an unknown quantity at this point
Code:
	var xmlhttp = new XMLHttpRequest(); // You must Initialize
	xmlhttp.open("GET","x.xml",false); // async is false, which is fine, but try async sometime
	xmlhttp.send(); // no need for null
	var x=xmlhttp.responseXML.getElementsByTagName("Student"); // only need one variable
	for(var i=0,j=x.length;i<j;i++){ // DECLARE VARIABLE if "i" is defined in window then it'll be overwritten
           Code in for loop should be fine 
        }
When it comes to reponseXML your XML MUST be VALID to your browser expecially. This code was tested on Chrome 22.
Jimmaay is offline   Reply With Quote