Firefox not responding to change in XML file

zvnbadboy

New Member
\[code\]window.onload = initAll;var xhr = false;var dataArray = new Array();var data = http://stackoverflow.com/questions/14081571/new Array();var url ="scripts/XML/colors.xml";function initAll() { if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else { if (window.ActiveXObject) { try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } } if (xhr) { xhr.onreadystatechange = setDataArray; xhr.open("GET", url, true); xhr.send(null); } else { alert("Sorry, but I couldn't create an XMLHttpRequest"); }}function setDataArray() { var tag1 = "color"; var tag2 = "name"; if (xhr.readyState == 4) { if (xhr.status == 200) { if (xhr.responseXML) { var allData = http://stackoverflow.com/questions/14081571/xhr.responseXML.getElementsByTagName(tag1); for (var i=0; i<allData.length; i++) { dataArray = allData.getElementsByTagName(tag2)[0].firstChild.nodeValue; } } } else { alert("There was a problem with the request " + xhr.status); } }}\[/code\]So this is my code from AJAX pretty basic simple connection to the XML file it all works fine up to when i add this line \[code\]data = allData.getElementsByTagName("code")[0].firstChild.nodeValue;\[/code\] in the for loop since i made recently some changes to the XML file added a \[code\]code\[/code\] tag to this is how the xml looks like:\[code\]... <color> <name>Azure</name> <value>#F0FFFF</value> <code>B</code> </color>...\[/code\]Firefox just dose not respond to the change I made it just doesn't recognize the "code" tags but in Google Chrome it works fine and any change i make to the XML values even to the two tags it does recognize the \[code\]Value\[/code\] and the \[code\]Name\[/code\] it just doesn't see the changes.I have this XML file from Lynda.com I have watched their AJAX tutorial.So could anyone help me whit this is there a special way to add or make changes to the XML file so that Firefox can recognize it ?
 
Back
Top