469,287 Members | 2,546 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

"xmlhttprequest is undefined" error in IE6

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").innerHT ML = data;
}

}
can anyone see the problem here?

thanks

marc

Feb 9 '07 #1
2 15166
On Feb 9, 12:38 pm, libsfan01 wrote:
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.

Feb 9 '07 #2
libsfan01 wrote:
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 //

}
--
http://www.hunlock.com -- Musings in Javascript, CSS.
$FA
Feb 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Don Vaillancourt | last post: by
49 posts views Thread by matty | last post: by
5 posts views Thread by Pseudonyme | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.