473,387 Members | 1,290 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 18215


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: David | last post by:
Hello I'm testing the XMLHttpRequest object in Firefox and IE. The code below works well in IE and Firefox. It shows "1" when the string is a number and "0" when not. The page aspxTest.aspx only...
3
by: Sergey Surkov | last post by:
Hello Does anybody know how to make FireFox to cache data that comes via XMLHttpRequest? Here is the issue I deal with: - On the web server (apache2) I have a static xml file test.xml - When I...
2
by: petermichaux | last post by:
Hi, I thought it is about time I tried writing some JavaScript with XMLHttpRequest instead of just using the Yahoo! UI library. The simple page below works in both Safari and Opera but I don't...
13
by: TLaufenberg | last post by:
I'm new to Javascript programming and I've run into a bit of a snag with making an XMLHttpRequest in the Safari browser. Actually, the request doesn't work in Firefox either but only when I use a...
5
by: Peter Michaux | last post by:
Hi, The FAQ correctly says the following: "Mozilla (NN6.2+, Firefox, Ice Weasle etc), Opera 7.6+, Safari1.2+, the Windows version of IE versions 5+, and some other browsers provide the XML...
1
by: Charlie | last post by:
I am trying to make an XMLHttpRequest which violates the default "same- origin"policy in Firefox. I checked the archives and found a method that should work but it does not. Below is the test code...
5
by: HugeBob | last post by:
Hi All, I've got a question about Asynchronous vs Synchronous mode with the XMLHttpRequest object. What are the ramifications of using one mode vs the other? If the script uses Asynchronous...
1
by: shankwheat | last post by:
I use this code to populate a selectbox with a group of records from a database. It executes very quickly with FireFox 2.0 but takes 7-10 secs with IE6 and IE7. Just wondering if anyone had any...
1
by: Iain Adams | last post by:
My code is as follows. http_request = false; if (window.XMLHttpRequest) { alert("firefox"); http_request = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { alert("ie");
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.