Mozilla XMLHttpRequest

B

Benedikt Wismans

Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7) Gecko/20040630

Dear group,

below is a simple XML request. It works fine, the only problem is that
Mozilla dos not quit the data transfer mode but keeps on "waiting for data
from host..." and the Mozilla icon keeps on moving for ever. Again,
everything works fine, but it is annoying.
The same behaviour occurs with Mozilla 1.8 and GET/urlencoded data

Any hint?

thanks,
Benedikt

-
var oXMLHttpRequest = new XMLHttpRequest();
XMLHttpRequest.open("POST", "http://"+cAPPLICATIONSERVER+cSISSRV, false);
oXMLHttpRequest.setRequestHeader("Content-Type","multipart/form-data");
oXMLHttpRequest.setRequestHeader("Content-Encoding","ISO-8859-1");
oXMLHttpRequest.setRequestHeader("Accept","text/xml");
oXMLHttpRequest.setRequestHeader("Cache-Control","no-cache");

try {
oXMLHttpRequest.send(this.oXMLDoc);
try {
return oXMLHttpRequest.responseXML;
}
catch(e) {
alert('Der XML-Response kann nicht interpretiert werden');
return null;
}
return oXMLHttpRequest.responseXML;
}
catch(e) {
alert('Der XML-Stream konnte nicht geöffnet oder empfangen werden');
return null;
}
 
M

Martin Honnen

Benedikt said:
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7) Gecko/20040630

below is a simple XML request. It works fine, the only problem is that
Mozilla dos not quit the data transfer mode but keeps on "waiting for data
from host..." and the Mozilla icon keeps on moving for ever. Again,
everything works fine, but it is annoying.

var oXMLHttpRequest = new XMLHttpRequest();
XMLHttpRequest.open("POST", "http://"+cAPPLICATIONSERVER+cSISSRV, false);

It seems you would want
oXMLHttpRequest.open(...)
and not
XMLHttpRequest.open(...)
oXMLHttpRequest.setRequestHeader("Content-Type","multipart/form-data");

Why the Content-Type header as multipart/form-data

oXMLHttpRequest.send(this.oXMLDoc);

this looks more like you are sending an XML document. But that is a
guess from your variable name.
return oXMLHttpRequest.responseXML;

As for that problem does that occur with any URL you are trying to load
or only with a particular URL or at least server?
Have you tried asynchronous loading, e.g.
oXMLHttpRequest.open(..., ..., true)
together with an onreadystate handler?

How are you calling the code above, maybe you are just lacking a return
false or similar in an onclick handler of a link.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,156
Latest member
KetoBurnSupplement
Top