473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

XMLhttp queuing?

Dear All,

Please excuse the following thickness, I am new to client scripting.

I have set up a page comprising of three DIVs, the content of which
gets changed by XMLHTTP requests (including the following code in a
function).

if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
document.getElementById(loc).innerHTML = xmlhttp.responseText;
}

My problem is when the page first loads. I had assumed that I could
just use onLoad to run a function that gets the data, but it gets
confused by the fact that it receives three queries in rapid
succession, before the server has had time to reply. How could I go
about queuing the requests so that they wait for one to load before the
next on triggers?

Everything works so well if I manually set up the pages - this is one
of the last hurdles I need to get through to have a promising looking
prototype. I am so impressed with how much more can be done with
JavaScript that when I last used it (a few years ago now) - no more
pages that strobe a rainbow of colours when you visit them!

I'd gratefully appreciate any advice that you (my obvious intellectual
superiors!) could provide on the issue.

Thank you kind Sirs (and Ladies),

Dan
(email not working - group reply appreciated)

Apr 2 '06 #1
1 1304
da*******@hotmail.com said on 03/04/2006 4:34 AM AEST:
Dear All,

Please excuse the following thickness, I am new to client scripting.

I have set up a page comprising of three DIVs, the content of which
gets changed by XMLHTTP requests (including the following code in a
function).

if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
document.getElementById(loc).innerHTML = xmlhttp.responseText;
}

My problem is when the page first loads. I had assumed that I could
just use onLoad to run a function that gets the data, but it gets
confused by the fact that it receives three queries in rapid
succession, before the server has had time to reply. How could I go
about queuing the requests so that they wait for one to load before the
next on triggers?


Firstly, what is 'it' referring to in '...it gets confused'? You need
to provide some error messages. A bit more code and snippet of HTML
might help too - just enough to show the error, not your entire application.

Secondly, are you creating the xmlhttp object as a global variable
(which seems pretty common). If so, you may be over-writing it with
subsequent calls.

You can queue the requests simply by having synchronous requests where
each request calls the next one - but that defeats the purpose of
HttpRequest to a large extent.

Consider using this stuff:

<URL:http://www.ajaxtoolbox.com/>
Look in the examples, there is one for a number of simultaneous
asynchronous requests.

--
Rob
Apr 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
5
by: jim.frantzen | last post by:
You have an active XMLHTTP request on the main page (localhost/App1/index.aspx) The XMLHTTP request takes about 60 seconds to receive a response back from localhost/App1/getxml.aspx. You have an...
4
by: Just D. | last post by:
Did anybody use this Message Queuing and knew all details about it? What's the physical limit of this Message Queuing system, number of messages, mbytes, message size? Where it stores messages,...
1
by: tiger | last post by:
Hi, I have a question on MS Message queuing. I would like to check a message queuing to see if there is a message in the queue. That is if the queue is empty, I would like to send a note to...
1
by: Dave Pink | last post by:
I support a web server farm of about 80 machines, of which 35 are in Production at any given time. Machines are running Windows 2000 Advanced Server with IIS 5. All 80 machines are configured...
9
by: balakrishnan.dinesh | last post by:
hi friends, Exactly what i want to know is, In my product we are using xmlhttp request to retrive some data from the server, And Im using IE browser, its working fine in IE. Now i want to work...
13
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to...
3
by: Andrewh | last post by:
Hi, I am having a bit of a problem with using xmlhttp. The code of the javascript file is shown below used in Windows XP. var xmlhttp = null; function SetURLDiv(url) { if...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.