XMLHttpRequest and Firefox Problem

26 views
Skip to first unread message

gobera

unread,
May 3, 2005, 3:11:36 PM5/3/05
to
There seems to be a problem with XMLHttpRequest and Firefox when the
function that makes the asynchrounous request is called from another
window. The request was made ok (open and send), but when trying to
retreive data from the object (like status or responseXML), it threw
the exception:

Error: [Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult:
"0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame ::
http://localhost/js/common.js :: processReqChange :: line 65" data:
no]
Source File: http://localhost/js/common.js
Line: 65

The function that creates an XMLHttpRequest object and loads the XML
document is called loadXML (taken from
http://developer.apple.com/internet/webcontent/xmlhttpreq.html)
I solved the problem by wrapping the call to the loadXML function in
setTimeout("loadXMLDoc('"+url+"')", 0);

I don't know why it happened or why this worked, but this solved my
problem.
I hope this is useful to somebody with the same problem.

Reply all
Reply to author
Forward
0 new messages