Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Below code throws error in Internet Explorer browser.

function createRequestObject()
{var tmpXmlt;
   if (window.XMLHttpRequest) {
       // Mozilla, Safari would use this method ...
       tmpXmlt = new XMLHttpRequest();
   } else if (window.ActiveXObject) {
      // IE would use this method ...
      try { tmpXmlt= new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
      catch (e1) {}
      try { tmpXmlt=new ActiveXObject("MSXML2.XMLHTTP.3.0"); }
      catch (e2) {}
      try { tmpXmlt= new ActiveXObject("Msxml2.XMLHTTP"); }
      catch (e3) {}
      //Microsoft.XMLHTTP points to Msxml2.XMLHTTP.3.0 and is redundant
     throw new Error("This browser does not support XMLHttpRequest.");
  }
return(tmpXmlt);
}

var xmlhttp = createRequestObject();

function makeGetRequest() {
    xmlhttp.open('get', 'data.xml',false);
    xmlhttp.onreadystatechange = processResponse;
    xmlhttp.send(null);
}
Posted
Updated 1-Apr-10 4:09am
v5

1 solution

What is the error? What version of Internet Explorer? Have you tried in other browsers and does it work?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900