rfresh
asked on
Javascript Error: Reference to undefined variable: No such variable 'XMLHttpRequest'
In Opera 7.23 I'm getting the following error on my Ajax code:
message: Reference to undefined variable: No such variable 'XMLHttpRequest'
My create XMLHttpRequest code:
function createRequestObject()
{
var request_o; //declare the variable to hold the object.
var browser = navigator.appName; //find the browser name
if (browser == "Microsoft Internet Explorer")
{
/* Create the object using MSIE's method */
request_o = new ActiveXObject("Microsoft.X MLHTTP");
}
else
{
/* Create the object using other browser's method */
request_o = new XMLHttpRequest();
}
return request_o; //return the object
}
var http = createRequestObject();
Can anyone explain why I'm getting this JS error?
message: Reference to undefined variable: No such variable 'XMLHttpRequest'
My create XMLHttpRequest code:
function createRequestObject()
{
var request_o; //declare the variable to hold the object.
var browser = navigator.appName; //find the browser name
if (browser == "Microsoft Internet Explorer")
{
/* Create the object using MSIE's method */
request_o = new ActiveXObject("Microsoft.X
}
else
{
/* Create the object using other browser's method */
request_o = new XMLHttpRequest();
}
return request_o; //return the object
}
var http = createRequestObject();
Can anyone explain why I'm getting this JS error?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the 'A'
if (browser == "Microsoft Internet Explorer")