XMLHttpRequest in IE

J

jackchang1

Hi, group

I have a problem with IE when using XMLHttpRequest object in
asynchronous mode. I have a page, and when it is closed, the onunload
event handler of the page will create an XMLHttpRequest object and
post some data back to the server. If I set it to asynchronous, next
time when I try to launch the same page, the IE browser hangs there.
But after I set it to synchronous, everything is fine. I didn't know
why. Can anyone give me some hints? thanks!
 
J

jackchang1

Hi, group

I have a problem with IE when using XMLHttpRequest object in
asynchronous mode. I have a page, and when it is closed, the onunload
event handler of the page will create an XMLHttpRequest object and
post some data back to the server. If I set it to asynchronous, next
time when I try to launch the same page, the IE browser hangs there.
But after I set it to synchronous, everything is fine. I didn't know
why. Can anyone give me some hints? thanks!

I tried to check the state for the XMLHttpRequest object, and it
seemed that it stopped at 1.
 
P

Peter Michaux

Hi, group

I have a problem with IE when using XMLHttpRequest object in
asynchronous mode. I have a page, and when it is closed, the onunload
event handler of the page will create an XMLHttpRequest object and
post some data back to the server. If I set it to asynchronous, next
time when I try to launch the same page, the IE browser hangs there.
But after I set it to synchronous, everything is fine. I didn't know
why. Can anyone give me some hints? thanks!

I haven't tried to make and XHR request onunload.

What are you trying to accomplish and what information are you trying
to send to the server? Perhaps you could use a GET request by creating
an image object?

Peter
 
J

jackchang1

It is some form data. At the beginning I used the form submit event to
post the data. The problem is that in one event (i.e., unload) the
form needs to be posted more than once, but only the last submit event
survives. So I switch to use XHR, but I bumped into this IE specific
problem. It works fine on FireFox.
 
M

matatunos

(e-mail address removed) a couché sur son écran :
It is some form data. At the beginning I used the form submit event to
post the data. The problem is that in one event (i.e., unload) the
form needs to be posted more than once, but only the last submit event
survives. So I switch to use XHR, but I bumped into this IE specific
problem. It works fine on FireFox.
On Oct 16, 1:11 pm, Peter Michaux <[email protected]> wrote:

does it work with IE7?

in my code..

var http_request = false;
if (window.XMLHttpRequest)
{ // Mozilla, Safari,... and IE7
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType)
{
http_request.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject)
{ // IE6
 

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,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top