Re: Problem with XmlHttpRequest (0x80040111 / nsIXMLHttpRequest.status) on several configurations
- From: "VK" <schools_ring@xxxxxxxxx>
- Date: 16 Jan 2006 04:01:01 -0800
Greg wrote:
> Hi,
>
> I've designed a bookmark in Ajax / PHP that I will put soon on
> sourceforge.net.
> But I've got an very tricky bug.
> I try it on some computers with Internet Explorer/Windows, Firefox
> 1.07/Linux, Firefox 1.5/Linux, Firefox 1.5/Windows and Firefox 1.5/Mac,
> Safari/Mac.
> It works perfectly on a lot of configurations but, on some PC with
> Firefox 1.5/Windows (not all), the Javascript code with XmlHttpRequest
> don't work at all and I've got this message when I refresh the webpage
> :
> --------------------------------------------------------------------------------------
> "Erreur : [Exception... "Component returned failure code: 0x80040111
> (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult:
> "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame ::
> http://someWebServer/BookmarkAjax/js/requestor.js :: anonymous :: line
> 52" data: no]
> Fichier source : http://someWebServer/BookmarkAjax/js/requestor.js
> Ligne : 52"
> --------------------------------------------------------------------------------------
>
> Here is the source :
> --------------------------------------------------------------------------------------
> "function getReadyStateHandler(req, responseXmlHandler) {
> // Return an anonymous function that listens to the XMLHttpRequest
> instance
> return function () {
> // If the request's status is "complete"
> if (req.readyState == 4) {
>
> // Check that a successful server response was received
> >>> L.52 >>>> if (req.status == 200) {
>
> // Pass the XML payload of the response to the
> // handler function
> var debug = document.getElementById("debug");
> debug.innerHTML += "<br/>" + req.status + " " + req.statusText;
>
> responseXmlHandler(req.responseXML);
>
> } else { ..."
> --------------------------------------------------------------------------------------
> This piece of source code comes from an IBM's article :
> http://www-128.ibm.com/developerworks/library/j-ajax1/?ca=dgr-lnxw01Ajax
>
> It's very strange because it is working on some configurations and not
> at all on others, all based on Firefox 1.5/Windows....
> There's a lot of message on the web about this kind of error but I
> don't find this exactly case !
> I would be glad if somebody could help me.
> (I can give you an access on the web application by email if you wan't
> to reproduce this bug)
> Thanks - Greg
Replace:
if (req.status == 200)
to:
if (req.status == 200)||(req.status == 0))
If it helps, ask my why (and you owe me a bottle of Bordeaux of a good
year :-D
.
- Follow-Ups:
- Re: Problem with XmlHttpRequest (0x80040111 / nsIXMLHttpRequest.status) on several configurations
- From: Thomas 'PointedEars' Lahn
- Re: Problem with XmlHttpRequest (0x80040111 / nsIXMLHttpRequest.status) on several configurations
- Prev by Date: comp.lang.javascript FAQ - Quick Answers- 8.1 - 2005-11-05
- Next by Date: Re: Javascript accessing an array of checkboxes
- Previous by thread: Re: Problem with XmlHttpRequest (0x80040111 / nsIXMLHttpRequest.status) on several configurations
- Next by thread: Re: Problem with XmlHttpRequest (0x80040111 / nsIXMLHttpRequest.status) on several configurations
- Index(es):
Relevant Pages
|