Re: Problem with XmlHttpRequest (0x80040111 / nsIXMLHttpRequest.status) on several configurations




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

.



Relevant Pages

  • Problem with XmlHttpRequest (0x80040111 / nsIXMLHttpRequest.status) on several configurations
    ... But I've got an very tricky bug. ... Firefox 1.5/Windows, ... // Check that a successful server response was received ... This piece of source code comes from an IBM's article: ...
    (comp.lang.javascript)
  • Re: Yet another crash in FreeBSD 5.1
    ... >> You don't actually need a crash dump to debug a stack traceback. ... That is precisely what doing what I suggested discovers, Greg. ... the locking didn't prevent it) or SMP races (if the locking didn't ... the line in the source code that was failing for him from his ...
    (freebsd-current)
  • Re: Is this normal?
    ... have Opera as alternate browser. ... Many many thanks Greg ... It will prevent the majority of the focus stealing ... And unlike IE, Firefox ...
    (microsoft.public.windowsxp.general)
  • Re: C# Threading Handbook Source Code
    ... Or Greg can contact him ... >> Does anyone know where I can get the source code for the Wrox (now ... >> APress) book C# Threading Handbook by Tobin Titus. ... >> APress web site, no files are available for that book. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: VS.NET-like interface: Docked Panels, Tabs, etc
    ... Greg ... > Does anybody knows where I can find the source code for what I'm ... Any help our hints would be really apreciated! ...
    (microsoft.public.dotnet.languages.vb)