rhyspaterson Posted September 23, 2008 Share Posted September 23, 2008 Have a strange issue here lads. ... ... for(var x = 0; x < allPrinters.length; x++){ importXML(allPrinters[x]); // ------------------------------------------------- alert('foo'); // ------------------------------------------------- var name = xmlDoc.getElementsByTagName("system.sysname.0")[0].childNodes[0].nodeValue; var type = xmlDoc.getElementsByTagName("25.3.2.1.3.1")[0].childNodes[0].nodeValue; var consoleDisplay = xmlDoc.getElementsByTagName("43.16.5.1.2.1.1")[0].childNodes[0].nodeValue; var row = document.createElement('TR'); tmp.appendChild(row); var container = document.createElement('TD'); container.innerHTML= x; row.appendChild(container); var container = document.createElement('TD'); container.innerHTML=name; row.appendChild(container); var container = document.createElement('TD'); container.innerHTML=type; row.appendChild(container); var container = document.createElement('TD'); container.innerHTML=consoleDisplay; row.appendChild(container); } document.getElementById('writeroot').appendChild(newTable); ... The above code works, but only when i have the alert('foo'); in my code. Otherwise it just comes out blank (and with no errors - firebug says nothing, nor IE). Seems to be an issue with writing to the DOM, but i have no idea what is going on. The code is looping through ~80 xml files (don't ask me why ) and loading them into the DOM each time. Then i just grab a few variables and write them to the page. It only works when i put the alert in there though (and have to press OK ~80 times haha). Suggestions? Cheers, Rhys Link to comment https://forums.phpfreaks.com/topic/125426-solved-javascript-and-the-xml-dom/ Share on other sites More sharing options...
web_loone_08 Posted September 23, 2008 Share Posted September 23, 2008 it may be a result of you using all those periods in your tags - getElementsByTagName may have an issue with that. Link to comment https://forums.phpfreaks.com/topic/125426-solved-javascript-and-the-xml-dom/#findComment-648546 Share on other sites More sharing options...
rhyspaterson Posted September 24, 2008 Author Share Posted September 24, 2008 AJAX seems to have solved the issue. I guess IE 6 couldn't keep up with any of the requests. Link to comment https://forums.phpfreaks.com/topic/125426-solved-javascript-and-the-xml-dom/#findComment-649174 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.