Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
does IE6 prevent multiple async xmlhttprequests per browser?

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help
View previous topic :: View next topic  
Author Message
warrenz
New one
New one


Joined: 16 Nov 2007
Posts: 2
Location: new jersey, usa

PostPosted: Fri Nov 16, 2007 6:47 pm    Post subject: does IE6 prevent multiple async xmlhttprequests per browser? Reply with quote

Does anyone know if Internet Explorer 6 has problems with multiple outstanding async XmlHttpRequests per browser instance occuring at the same time?

I created an ajax application to display continous streaming content by having a java script recursively call itself each time data comes back from the server. There needs to be multiple instances of the script running in different windows at the same time displaying streaming data from different sources through the same web server.
Problem I have is that in Internet Explorer 6, I need to open up a seperate instance of IE to run more than one XMLHttpRequest to the same web server. If I try to open multiple windows to the same web server, then the xmlhttprequests seem to become synchronous and block the user from doing anything in the browser while the requests are outstanding.
I have apache 2.0 running on the server. Is this a problem with IE 6 ? (can't have multiple outstanding XmlHttpRequests per browser instance? - The problem doesn't happen with Mozilla, nor does it happen if I open up multiple instances of IE 6. It only happens when I open up more than one window to the web server doing XmlHttpRequests in the same ie 6 instance at the same time.

Here is the code. anyone have any thoughts on this?

function requestMoreStreamingData () {
var oXHR2 = XmlHttp.createRequest();
oXHR2.open("get", "my_ajax_server.php?getmoredata", true);
oXHR2.onreadystatechange = function () {
if (oXHR2.readyState == 4) {
if (oXHR2.status == 200 || oXHR2.status == 304) {
displayTheData(oXHR2.responseText);
oXHR2.abort();
requestMoreStreamingData(); // call myself recursively
return;
}
else {
alert("An error occurred: " + oXHR2.statusText);
}
}
}
oXHR2.send(null);
}
Back to top
View user's profile Send private message
Jesdisciple
Frequent Poster
Frequent Poster


Joined: 20 Oct 2007
Posts: 36
Location: Tejas

PostPosted: Mon Nov 19, 2007 4:38 am    Post subject: Reply with quote

Could you give a complete, working example (Web page and all, but could be stripped of other components)? Giving it a context to work in is a lot easier for you than me, because you have the original.
_________________
In ALL things, strive for ><>,
Chris
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
warrenz
New one
New one


Joined: 16 Nov 2007
Posts: 2
Location: new jersey, usa

PostPosted: Thu Nov 22, 2007 1:57 pm    Post subject: Reply with quote

thanks, for your reply. stripping out the stuff that is application specific is very time consuming, so I really couldn't send a full working web page.

but after some trouble shooting, I did find the problem. It was a simple matter of making certain that before the page unloads I make sure I abort any xmlhttprequest that is outstanding by calling the abort() method. I am doing this with <body onbeforeunload="abort_ajax();"> which does the following:

abort_ajax() {
if (oXHR2) oXHR2.abort();
}

I also had to move the declaration of oXHR2 outside of my function and make it global to the page.

It seems in IE6 if you have an xmlhttprequest which the server has not yet replied to still waiting for a response when the page unloads because of another (non ajax) submit of the page, the outstanding request never gets closed, and they sort of stack up and hang up the browser when multiple windows are open in the same instance of the browser. Again I say it seems that way in IE 6 based on my testing.

It was also important for me to put a return; after I recursively called my javascript, so I would not do another send().

It seems to be working now.
thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert