P
Prasad
Hi all,
I wanted to know whether my page is connecting to server or not using
xmlHttp request.
For that , I am using one condition in onreadystatechange function as..
function xxx()
{
if(xmlhttp.readyState==4)
{
if(xmlhttp.status!=200)
{
error_handler();
}
----------
---------------------
}
}
This is working fine in IE when there is no connectivity with server( I
stoped the server)..
But it's giving exception in mozilla/firefox when I stopped the server
(only when I stop .),
at line 65 in my code, as
[Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult:
"0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame ::
http://localhost/teamkollab/chat2/chat-ajax.js :: responseDisplayChat
:: line 65" data: no]
line 65 is
-------------- if(xmlhttp.status != 200)
I could not access the xmlhttp.status variable .
Does it mean that xmlhttp object won't be returned with status code
when it can not connect to a page ??
If yes, what will it return to know the status ??
How could I solve this to not to get such exception ?
Please help me out ,
Thanks in advance
I wanted to know whether my page is connecting to server or not using
xmlHttp request.
For that , I am using one condition in onreadystatechange function as..
function xxx()
{
if(xmlhttp.readyState==4)
{
if(xmlhttp.status!=200)
{
error_handler();
}
----------
---------------------
}
}
This is working fine in IE when there is no connectivity with server( I
stoped the server)..
But it's giving exception in mozilla/firefox when I stopped the server
(only when I stop .),
at line 65 in my code, as
[Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult:
"0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame ::
http://localhost/teamkollab/chat2/chat-ajax.js :: responseDisplayChat
:: line 65" data: no]
line 65 is
-------------- if(xmlhttp.status != 200)
I could not access the xmlhttp.status variable .
Does it mean that xmlhttp object won't be returned with status code
when it can not connect to a page ??
If yes, what will it return to know the status ??
How could I solve this to not to get such exception ?
Please help me out ,
Thanks in advance