View Full Version : Need help with XMLHttpRequest

08-12-2011, 01:27 AM
I'm starting to learn javascript and trying to get the below code to work with newer browsers. I'm not sure how to implement the below to make it work with XMLHttpRequest. There is a small form that uses this function to allow you to select an xml file to load. Your help is much appreciated. Thanks.

function importXML() {

if (document.implementation && document.implementation.createDocument) {
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.onload = createQuiz;
else if (window.ActiveXObject) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.onreadystatechange = function () {
if (xmlDoc.readyState == 4) createQuiz()
else {
alert('Your browser cannot handle this script');

08-12-2011, 09:59 AM
Look what I did for that in my post [URL="http://www.codingforums.com/showthread.php?t=234822"]post