473,587 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,

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

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


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_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]


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*******@yaho o.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_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]


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*******@yaho o.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.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/
Jul 23 '05 #4
Martin Honnen <ma*******@yaho o.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_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/
Jul 23 '05 #6
Martin Honnen <ma*******@yaho o.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
17984
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 write "0" or "1" with a "response.write" method. The problem that I have is when I try this example with Synchronous mode. If I change the function...
3
12620
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 download test.xml using XMLHttpRequest, FireFox always gets complete test.xml from the server, thus not using the browser cache (apache sends 200 OK...
2
21865
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 see the alert in Firefox. Looking in Firefox's firebug plugin, I see that the request is successfully sent and the correct response is received. Any...
13
11477
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 Mac computer. IE and FireFox on a Windows based system works just fine. The problem I am having is that the XMLHttpRequest doesn't open the site...
5
2383
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 HTTP Request object." In my haze of testing yesterday it seems that NN6.1 provides an non-functional XMLHttpRequest object and NN6.2 XMLHttpRequest...
1
25089
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 I isolated. I set signed.applets.codebase_principal_support true and seemed to get the UniversalBrowserRead permission but then the open still...
5
15496
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 mode, it sounds as if a thread retrieves the data from the supplied URL and the JS function that called the open() and send() methods continues on. ...
1
5915
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 pointers for improving this code to make IE run it faster or I am just stuck with it? Thanks function GetXmlHttpObject() { var objXMLHttp=null
1
1767
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
7915
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.