Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
| Search | Today's Posts | Mark Forums Read
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 14th, 2005, 06:49 AM
Authorized User
 
Join Date: Jul 2005
Location: Chennai, Tamil Nadu, India.
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple Concurrent Requests to XmlHttpRequest

Hi,

When we are using XmlHttpRequest to get and submit data with the webserver, please advise what would be the modus operandi to handle concurrent requests.

We would be using a syntax similar to

req = new XmlHttpRequest();
req.onreadystatechange() = function()
{

}

This req object would be erased before it the function returns for the next call.

How would be go about declaring dynamic req object in JavaScript.

Any pointers...

Vasudevan Deepak Kumar
Personal Web: http://www.lavanyadeepak.tk/
I Blog At: http://deepak.blogdrive.com/ and http://deepakvasudevan.blogspot.com/
__________________
Vasudevan Deepak Kumar
Personal Web: http://www.lavanyadeepak.tk/
I Blog At: http://deepak.blogdrive.com/ and http://deepakvasudevan.blogspot.com/
  #2 (permalink)  
Old December 15th, 2005, 12:39 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What about setting up a global array where you can push() and new req object onto the array each time the request is made.

-Peter
  #3 (permalink)  
Old January 19th, 2006, 07:32 AM
Authorized User
 
Join Date: May 2004
Location: , , .
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Default

It depends on what your looking to do.

You could use multiple XMLHttpRequest objects or have them working in synchronus mode rather than Asynchronus.

I've had to go down the synchronus route because the values of the first request have an impact on the second.

  #4 (permalink)  
Old March 22nd, 2006, 04:56 AM
Authorized User
 
Join Date: Jul 2005
Location: Westchester County, NY, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prophet Send a message via MSN to prophet
Default

Gilf,

When I encounter a situation where a XMLHTTP request depends on a previous request’s completion, I simply call it when the first request completely loads. Keeping all XMLHTTP calls asynchronous, in my opinion, prevents a counter intuitive user experience.

Bradley Baumann


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concurrent Framework 1 + 2 on Windows Srvr 2003 ruairi ASP.NET 1.x and 2.0 Application Design 4 August 31st, 2006 11:25 AM
Concurrent Caching akkad C# 2005 0 August 13th, 2006 01:05 AM
Multiple Concurrent Requests to XmlHttpRequest deepak.vasudevan Javascript 0 November 14th, 2005 06:49 AM
Multiple http-requests are stuck MereMortal C++ Programming 2 May 9th, 2005 03:46 PM
Multiple simultaneous asynchronous requests mehdi62b ASP.NET 1.0 and 1.1 Professional 18 August 25th, 2004 04:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.