XmlHTTPRequest and Firefox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Smith

    #1

    XmlHTTPRequest and Firefox

    This is a bit of a weird problem. Unfortunately, I can't reproduce it
    in a simple example, so I can only poke it out there and see if anyone
    has seen something similar.

    I have a script that uses XMLHttpRequest to communicate to a server.
    All functionality follows the following form:

    1. Use XMLHttpRequest to make a request to the server.
    2. Wait for the response (using async requests and a handler)
    3. If the response indicates an error, then stick up an alert() box.
    4. If no error, reload a frame (the script is in the frameset).

    Under IE, this works fine. Under Firefox (Mozilla/5.0 (Windows; U;
    Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1) it works most
    of the time.

    On Firefox, there is one request that very predictably breaks things.
    But the way things break is odd. That request works flawlessly; but
    then *any* call to XMLHttpRequest' s "open" method after that throws an
    exception; control never reaches the server-side code that's being
    called. Creating a new XMLHttpRequest object solves the problem.

    The error message from Firefox is:

    Error: uncaught exception: [Exception... "Component returned failure
    code: 0x80004005 (NS_ERROR_FAILU RE) [nsIXMLHttpReque st.open]" nsresult:
    "0x80004005 (NS_ERROR_FAILU RE)" location: "JS frame ::
    http://fengshui.mindiq.com/mindiq/ac.../takeCourse.js ::
    dacMoveNext :: line 228" data: no]

    This isn't really critical, since it does work now (I'm just creating a
    new XMLHttpRequest object each time). However, I'm quite curious what
    was broken the old way.

    Thanks for any helpful comments,

    --

    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
  • Martin Honnen

    #2
    Re: XmlHTTPRequest and Firefox



    Chris Smith wrote:

    [color=blue]
    > I have a script that uses XMLHttpRequest to communicate to a server.
    > All functionality follows the following form:
    >
    > 1. Use XMLHttpRequest to make a request to the server.
    > 2. Wait for the response (using async requests and a handler)
    > 3. If the response indicates an error, then stick up an alert() box.
    > 4. If no error, reload a frame (the script is in the frameset).
    >
    > Under IE, this works fine. Under Firefox (Mozilla/5.0 (Windows; U;
    > Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1) it works most
    > of the time.[/color]

    That is a prerelease version of Firefox, the current release is 1.0. So
    tell us whether you have tested with 1.0 too and whether the problem
    occurs only with that 0.10.1 prerelease or with the real 1.0 release too.
    [color=blue]
    > On Firefox, there is one request that very predictably breaks things.[/color]

    We need to see details about the script, the request (HTTP method e.g.
    HEAD, GET, POST, data sent) and the response.
    I understand that you say it only occurs in your application but if that
    is online then post a URL and explain what needs to be done to cause the
    problem.
    [color=blue]
    > But the way things break is odd. That request works flawlessly; but
    > then *any* call to XMLHttpRequest' s "open" method after that throws an
    > exception; control never reaches the server-side code that's being
    > called. Creating a new XMLHttpRequest object solves the problem.
    >
    > The error message from Firefox is:
    >
    > Error: uncaught exception: [Exception... "Component returned failure
    > code: 0x80004005 (NS_ERROR_FAILU RE) [nsIXMLHttpReque st.open]" nsresult:
    > "0x80004005 (NS_ERROR_FAILU RE)" location: "JS frame ::
    > http://fengshui.mindiq.com/mindiq/ac.../takeCourse.js ::
    > dacMoveNext :: line 228" data: no][/color]

    I have tried loading that URL and looking at its source, at least the
    content I get doesn't contain any script with XMLHttpRequest.



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • Chris Smith

      #3
      Re: XmlHTTPRequest and Firefox

      Martin Honnen <mahotrash@yaho o.de> wrote:[color=blue]
      > That is a prerelease version of Firefox, the current release is 1.0. So
      > tell us whether you have tested with 1.0 too and whether the problem
      > occurs only with that 0.10.1 prerelease or with the real 1.0 release too.[/color]

      Yes, I have a report from someone that the same thing occurs in Firefox
      1.0. Interestingly enough, I was also just told that the same request
      that breaks the XMLHttpRequest object actually crashes the entire
      browser in Firefox 0.8 on Linux. I just reproduced tho original bug
      (not the crash) with 1.0 on Linux as well.
      [color=blue]
      > We need to see details about the script, the request (HTTP method e.g.
      > HEAD, GET, POST, data sent) and the response.
      > I understand that you say it only occurs in your application but if that
      > is online then post a URL and explain what needs to be done to cause the
      > problem.[/color]

      Okay, here you go.



      Log in as: test1
      Password: test1

      Click "Take Course" next to "Paul's Course" of any version (or any other
      course for that matter). Go forward to the first question, answer the
      question, and then the next and back buttons stop working.

      Unfortunately, this will not work well if several people are taking the
      same course with the same username -- the next and back buttons will
      cause *everyone* to move next or back. Since I'm posting the username
      and password to a newsgroups, that's somewhat likely. If things get
      confusing, try a different course, or wait till later to try again.
      [color=blue][color=green]
      > > Error: uncaught exception: [Exception... "Component returned failure
      > > code: 0x80004005 (NS_ERROR_FAILU RE) [nsIXMLHttpReque st.open]" nsresult:
      > > "0x80004005 (NS_ERROR_FAILU RE)" location: "JS frame ::
      > > http://fengshui.mindiq.com/mindiq/ac.../takeCourse.js ::
      > > dacMoveNext :: line 228" data: no][/color]
      >
      > I have tried loading that URL and looking at its source, at least the
      > content I get doesn't contain any script with XMLHttpRequest.[/color]

      Yes, and I got the emailed bug report telling me that someone was linked
      to that resource without having a course session first. Try the login
      procedure above.

      --

      The Easiest Way To Train Anyone... Anywhere.

      Chris Smith - Lead Software Developer/Technical Trainer
      MindIQ Corporation

      Comment

      • Martin Honnen

        #4
        Re: XmlHTTPRequest and Firefox



        Chris Smith wrote:
        [color=blue]
        > Martin Honnen <mahotrash@yaho o.de> wrote:[/color]
        [color=blue][color=green]
        >>We need to see details about the script, the request (HTTP method e.g.
        >>HEAD, GET, POST, data sent) and the response.
        >>I understand that you say it only occurs in your application but if that
        >>is online then post a URL and explain what needs to be done to cause the
        >>problem.[/color]
        >
        >
        > Okay, here you go.
        >
        > http://fengshui.mindiq.com/
        >
        > Log in as: test1
        > Password: test1[/color]

        If I load that URL above with Firefox 1.0 on Windows XP I am taken to
        <http://www.mindiq.com/elearning/dac/index.php>
        There are fields to login on that page but a link "Client Login" which
        takes me to
        <http://www.mindiq.com/client_login/index.php>
        There is a "Web Conference Login" and a "Client Login", trying the first
        now, takes me to a HTTP site with an expired certificate, URL starts with
        <https://www.webconferen ce.com/webconferencepr o/>
        where the page tells me "You cannot join any sessions at this time.".
        Trying the second login earlier takes me to
        <https://login.marketing central-ssl.com/index.mms>
        where I am told "The Company Code, UserID or Password you entered is
        invalid.".



        --

        Martin Honnen
        http://JavaScript.FAQTs.com/

        Comment

        • Chris Smith

          #5
          Re: XmlHTTPRequest and Firefox

          Martin Honnen <mahotrash@yaho o.de> wrote:[color=blue][color=green]
          > > http://fengshui.mindiq.com/
          > >
          > > Log in as: test1
          > > Password: test1[/color]
          >
          > If I load that URL above with Firefox 1.0 on Windows XP I am taken to
          > <http://www.mindiq.com/elearning/dac/index.php>[/color]

          I don't know how I managed to get the URL wrong. It's:



          Sorry about that!

          --

          The Easiest Way To Train Anyone... Anywhere.

          Chris Smith - Lead Software Developer/Technical Trainer
          MindIQ Corporation

          Comment

          • Martin Honnen

            #6
            Re: XmlHTTPRequest and Firefox



            Chris Smith wrote:

            [color=blue]
            > I don't know how I managed to get the URL wrong. It's:
            >
            > http://fengshui.mindiq.com/mindiq/[/color]

            I could login there, I have followed the procedure you have described in
            the earlier post with Firefox 1.0 on Windows XP here and indeed the error

            Error: uncaught exception: [Exception... "Component returned failure
            code: 0x80004005 (NS_ERROR_FAILU RE) [nsIXMLHttpReque st.open]" nsresult:
            "0x80004005 (NS_ERROR_FAILU RE)" location: "JS frame ::
            http://fengshui.mindiq.com/mindiq/ac.../takeCourse.js ::
            dacMoveNext :: line 243" data: no]

            is thrown.

            I have had a look at the code then but on a quick look can't find
            anything wrong there. One difference might be that in some functions you
            call abort, in another not, which of course might be intentionally.

            It is difficult to say what goes wrong, you know better which URLs are
            requested in what order from that app, if you can make a test case which
            throws that error it would be fine. You can file a bug on
            https://bugzilla.mozilla.org/, even without the test case, but obviously
            a test case would help.

            --

            Martin Honnen
            http://JavaScript.FAQTs.com/

            Comment

            • Chris Smith

              #7
              Re: XmlHTTPRequest and Firefox

              Martin Honnen <mahotrash@yaho o.de> wrote:[color=blue]
              > I have had a look at the code then but on a quick look can't find
              > anything wrong there. One difference might be that in some functions you
              > call abort, in another not, which of course might be intentionally.[/color]

              The abort was an attempt to fix the problem. The problem happens with
              or without it. In any case, I'm not able to put together a test that
              reproduces the problem. I did look through BugZilla, and it seems
              possible that this is the same problem as bug 246518. I don't have any
              reason to believe that this is a new or different bug. I'm just going
              to add my work-around (creating new instances of XMLHttpRequest) and go
              on.

              --

              The Easiest Way To Train Anyone... Anywhere.

              Chris Smith - Lead Software Developer/Technical Trainer
              MindIQ Corporation

              Comment

              Working...