469,336 Members | 5,276 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

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_FAILURE) [nsIXMLHttpRequest.open]" nsresult:
"0x80004005 (NS_ERROR_FAILURE)" 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,

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Jul 23 '05 #1
6 18048


Chris Smith wrote:

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.
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.
On Firefox, there is one request that very predictably breaks things.
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.
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_FAILURE) [nsIXMLHttpRequest.open]" nsresult:
"0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
http://fengshui.mindiq.com/mindiq/ac.../takeCourse.js ::
dacMoveNext :: line 228" data: no]


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/
Jul 23 '05 #2
Martin Honnen <ma*******@yahoo.de> wrote:
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.
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.
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.


Okay, here you go.

http://fengshui.mindiq.com/

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.
Error: uncaught exception: [Exception... "Component returned failure
code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.open]" nsresult:
"0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
http://fengshui.mindiq.com/mindiq/ac.../takeCourse.js ::
dacMoveNext :: line 228" data: no]


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


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.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Jul 23 '05 #3


Chris Smith wrote:
Martin Honnen <ma*******@yahoo.de> wrote:

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.

Okay, here you go.

http://fengshui.mindiq.com/

Log in as: test1
Password: test1


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.webconference.com/webconferencepro/>
where the page tells me "You cannot join any sessions at this time.".
Trying the second login earlier takes me to
<https://login.marketingcentral-ssl.com/index.mms>
where I am told "The Company Code, UserID or Password you entered is
invalid.".

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4
Martin Honnen <ma*******@yahoo.de> wrote:
http://fengshui.mindiq.com/

Log in as: test1
Password: test1


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>


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

http://fengshui.mindiq.com/mindiq/

Sorry about that!

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Jul 23 '05 #5


Chris Smith wrote:

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

http://fengshui.mindiq.com/mindiq/


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_FAILURE) [nsIXMLHttpRequest.open]" nsresult:
"0x80004005 (NS_ERROR_FAILURE)" 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/
Jul 23 '05 #6
Martin Honnen <ma*******@yahoo.de> wrote:
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.


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.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Sergey Surkov | last post: by
13 posts views Thread by TLaufenberg | last post: by
5 posts views Thread by Peter Michaux | last post: by
1 post views Thread by shankwheat | last post: by
1 post views Thread by Iain Adams | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.