Hello Codegurus,
The following piece of code returns a readystate that's "undefined".
The alert appears 4 times in IE and in FF. so i reckon the readystate changes 4 times ?; but it's always "undefined".
Could someone tell me what i'm doing wrong?, Thanks.
EDIT: Sorry, just noticed the AJAX forum. feel free to move this topic.
Code:function xmlHttpRequest(){ if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("XMLHTTP not supported."); return null; } } function ajaxFunction(){ var xhr = xmlHttpRequest(); xhr.onreadystatechange = function(){ alert(this.readystate); } xhr.open("GET","url",true); xhr.send(null); }


Reply With Quote
Bookmarks