"xmlhttprequest is undefined" error in IE6

L

libsfan01

In IE6 i get an error: "XMLHttpRequest is undefined", whereas in other
browsers (e.g. ie7) it works fine:

var get;

function getdata(region,page) {


get = new XMLHttpRequest();
get.onreadystatechange = processdata;
get.open("GET","myurl");
get.send(null);

}

function processdata() {

if (get.readyState == 4) {
data = get.responseText;
document.getElementById("results_display").innerHTML = data;
}

}


can anyone see the problem here?

thanks

marc
 
R

Richard Cornford

In IE6 i get an error: "XMLHttpRequest is undefined", whereas in other
browsers (e.g. ie7) it works fine:

Versions of IE prior to 7 used an ActiveX component for XML HTTP
requests.

Richard.
 
P

pcx99

libsfan01 said:
In IE6 i get an error: "XMLHttpRequest is undefined", whereas in other
browsers (e.g. ie7) it works fine:

var AJAX = null; //
Initialize the AJAX variable.
if (window.XMLHttpRequest) { //
Are we working with mozilla?
AJAX=new XMLHttpRequest(); //
Yes -- this is mozilla.
} else { //
Not Mozilla, must be IE
AJAX=new ActiveXObject("Microsoft.XMLHTTP"); //
Wheee, ActiveX, how do we format c: again?
} //
End setup Ajax.
if (AJAX==null) { //
If we couldn't initialize Ajax...
alert("Your browser doesn't support AJAX."); //
Sorry msg.
return false //

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top