Firefox javascript error
am using the following code where it is giving me an "Undefined" error
in Firefox while it is running well on IE, the line which cuz the error is "XHR.open("GET",url,true);", any idea ????
var XHR;
function BuildXHR(url)
{
if (window.XMLHttpRequest)
{
XHR = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
XHR = new ActiveXObject("Microsoft.XMLHTTP");
}
if (XHR == null)
{
alert ("Browser does not support HTTP Request");
return;
}
XHR.onreadystatechange = StateChanged;
XHR.open("GET",url,true);
XHR.send(null);
}
|