473,839 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with XmlHttpRequest (0x80040111 / nsIXMLHttpReque st.status) on several configurations

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_A VAILABLE) [nsIXMLHttpReque st.status]" nsresult:
"0x80040111 (NS_ERROR_NOT_A VAILABLE)" 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 getReadyStateHa ndler(req, responseXmlHand ler) {
// 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.getEle mentById("debug ");
debug.innerHTML += "<br/>" + req.status + " " + req.statusText;

responseXmlHand ler(req.respons eXML);

} else { ..."
--------------------------------------------------------------------------------------
This piece of source code comes from an IBM's article :
http://www-128.ibm.com/developerwork...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

Dec 17 '05 #1
42 34260
I've still got the problem.
I can't find why.

Jan 16 '06 #2
Greg wrote:
I've still got the problem.
I can't find why.

Have you tried if (req.status && req.status == 200)?

--
Ian Collins.
Jan 16 '06 #3
VK

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_A VAILABLE) [nsIXMLHttpReque st.status]" nsresult:
"0x80040111 (NS_ERROR_NOT_A VAILABLE)" 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 getReadyStateHa ndler(req, responseXmlHand ler) {
// 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.getEle mentById("debug ");
debug.innerHTML += "<br/>" + req.status + " " + req.statusText;

responseXmlHand ler(req.respons eXML);

} else { ..."
--------------------------------------------------------------------------------------
This piece of source code comes from an IBM's article :
http://www-128.ibm.com/developerwork...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.stat us == 0))

If it helps, ask my why (and you owe me a bottle of Bordeaux of a good
year :-D

Jan 16 '06 #4
VK wrote:
Replace:
if (req.status == 200)

to:
if (req.status == 200)||(req.stat us == 0))


`req.status' will never be 0 (and will never be converted to it implicitly,
see ECMAScript Ed. 3, sections 11.9.1 and 11.9.1), there is no such status
code in HTTP and the Microsoft IXMLHttpRequest interface reference, from
which Gecko's XMLHttpRequest derives, does not suggest the property could
hold this value or a value convertible to 0 ever. Therefore, the approach
Ian suggested is, unfortunately unsurprisingly, more reasonable than this.

<URL:http://msdn.microsoft. com/library/en-us/xmlsdk/html/f6de15fc-72e9-418e-b275-d94b0b2045de.as p>
<URL:http://xulplanet.com/references/objref/XMLHttpRequest. html>
PointedEars
Jan 16 '06 #5
VK

Thomas 'PointedEars' Lahn wrote:
`req.status' will never be 0 (and will never be converted to it implicitly,
see ECMAScript Ed. 3, sections 11.9.1 and 11.9.1)


I'm wondering what do you have to say about Windows issues if you
stated several times that you are under Linux? Unless you have Windows
installed as well ? Are we cheating? ;-)

FYI: using IXMLHTTPRequest for local (file:\\) files under Windows / IE
6.x returns status 0 is success. So if the said bookmarklet used both
for local and remote files, it may cause a hard to catch erratic
behavior, because for local files status will never be 200 - despite
the file itself will be perfectly loaded.
Also as you cannot set Content-Type for file:\\ (at least for Windows),
XML files loaded from harddrive do no trig XML parser (as it reacts on
Content-Type only, not on file extension), so for your local .xml files
responseXML is always "", only responseText is OK. That is another
erratic behavior which may draw you crazy because the same file may
parse just fine from server and "disappear" as soon as saved as local
file.

ECMAScript Ed. 3 doesn't know about it which is not a suprise of any
kind.

P.S. It is not the fact that it is the OP's problem, but something to
start with. Another explanation can be in Firefox' bookmarlet security
mechanics. We shall move on it if the above suggestion will fail.

Jan 16 '06 #6
Thanks for your replies but no one of your suggestions works...

I'm 2 days at my parent's office and they have several PCs with windows
and Firefox 1.5.
It's almost strange because the application works on the server but
doesn't on 2 'office' PCs.

If I print the readyState like this :
-------------------------------------------
try {
document.getEle mentById("conte nt").innerHTM L += req.readyState +
'&nbsp;';
if (req.readyState == 4) {
if (req.status == 200) {
responseXmlHand ler(req.respons eXML);
} else {
alert("HTTP error: "+req.statu s);
}
}
} catch(e) {
alert("Exceptio n : " + e);
}
-------------------------------------------
I've got :
- if it's working : 1 1 2 3 3 4
- if not : 1 1

And (on configuration wich it doesn't working), If I refresh the page,
I caught the exception 0x80040111 (NS_ERROR_NOT_A VAILABLE)
[nsIXMLHttpReque st.status]....

I will try to debug this piece of code during the day. If I find a
solution, I'll come back to you.

By the way, this address book project is now on SourceForge :
http://sourceforge.net/projects/gcontact
But, for now, screens are only available in French.

Jan 18 '06 #7
VK

Greg wrote:
Thanks for your replies but no one of your suggestions works...

I'm 2 days at my parent's office and they have several PCs with windows
and Firefox 1.5.
It's almost strange because the application works on the server but
doesn't on 2 'office' PCs.

If I print the readyState like this :
-------------------------------------------
try {
document.getEle mentById("conte nt").innerHTM L += req.readyState +
'&nbsp;';
if (req.readyState == 4) {
if (req.status == 200) {
responseXmlHand ler(req.respons eXML);
} else {
alert("HTTP error: "+req.statu s);
}
}
} catch(e) {
alert("Exceptio n : " + e);
}
-------------------------------------------
I've got :
- if it's working : 1 1 2 3 3 4
- if not : 1 1

And (on configuration wich it doesn't working), If I refresh the page,
I caught the exception 0x80040111 (NS_ERROR_NOT_A VAILABLE)
[nsIXMLHttpReque st.status]....


The list line sounds really close to
<http://ajaxtoolbox.com/forum/viewtopic.php?p =102&sid=f2be51 bc80038174198e5 f52e7d91554>

Does it help anyhow if you do not use any req properties in
else-brunch?

Jan 18 '06 #8
No... Don't use req properties in else brunch doesn't help...
Thank for the link, I'm looking if it can help me...

Jan 18 '06 #9
Wait !
Now, some HttpRequests are working !
But not on all functions on my application...
It's strange but now, I can look for differences between functions wich
are working and thoses which don't !
I think I will soon debug that problem !

Cool.

Jan 18 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5692
by: Henri Sivonen | last post by:
I got the following error: Error: " nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" .... with Firefox when using XMLHttpRequest. What's happenening? Is the object being garbage collected before the network operation finishes? My usage pattern is:
9
5591
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla, using the same HTML/JS it always returns no data (xmlhttp.responseText is null). When I try to get headers using Mozilla or display the http status code I get some obscure exception in the javascript console that I've given up on searching for an...
6
10927
by: Shigun | last post by:
On a website I am working on I am trying to load another page into a div on the the page the user does his work from. What I have works correctly in FireFox, but not in IE. I've rummaged Google for quite a bit and found similar problems, but no actual solutions. Here is the JavaScript I have to load a URL into a Div: function setResponseHtml(pUrl, pDiv) { var lHttp = getHTTPObjectHtml(); var lUrl = pUrl; lUrl =...
1
3198
by: wenijah | last post by:
Hi everyone! First thank you for reading this post and yes, you probably already see that kind of topic title somewhere but the problem I've got today might be different than the 100 topics I've seen so far that did not resolve my problem... Environment and problem: I have a page A with Ajax.js and a <div id="ajx">Content</div> that changes when clicking on a link. Another page, page B, gets loaded into page A and (tries) to load a...
3
2596
by: Andrewh | last post by:
Hi, I am having a bit of a problem with using xmlhttp. The code of the javascript file is shown below used in Windows XP. var xmlhttp = null; function SetURLDiv(url) { if (window.XMLHttpRequest) {
19
4383
by: RossGK | last post by:
I'm a bit new to javascript - as will be obvious below. I'm using an XMLHttpRequest to get a bit of data from server (django), and it works nicely for single events. But my eventual outcome needs to be a series of data transmissions. I figured requesting data over and over until the data is some value that triggers the stop would be an interesting first attempt. To move forward, I wrapped my initial single data request in a for-loop...
0
9697
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10295
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7829
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7018
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4487
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3136
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.