473,698 Members | 2,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ready State == 4) && (xmlhttp.status == 200)) {
document.getEle mentById(loc).i nnerHTML = xmlhttp.respons eText;
}

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 1327
da*******@hotma il.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.ready State == 4) && (xmlhttp.status == 200)) {
document.getEle mentById(loc).i nnerHTML = xmlhttp.respons eText;
}

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
4955
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., http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=Tidy7IDbDHA.2108%40cpmsftngxa06.phx.gbl) that indicate that ASP will queue up requests when they come in with the same "session".
9
5573
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, using the same HTML/JS it always returns no data (xmlhttp.responseText is null). When I try to get headers using Mozilla or display the http status code I get some obscure exception in the javascript console that I've given up on searching for an...
5
449
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 IFRAME on this main page. When you set the iframe's src to google.com, it works fine. When you set the iframe's src to localhost/App1/test.htm, it works fine. When you set the iframe's src to
4
5220
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, RAM, DISK? Do we lose everything if the machine is just rebooted or we can save all messages on disk to send them later where we're on line? Just D.
1
1639
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 a textbox. Thanks Tiger
1
1547
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 exactly the same in regards to software, yet only one machine repeatedly shows queuing on the performance counter ASP.NET Requests Queued. No other machines show any queuing at all. The queuing occurs on the machine in question only after it is put...
9
2380
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 with netscape,I dont know how to pass the xmlhttp request in Netscape. i got some code like below for netscape for xmlhttp var oXML=new XMLHttpRequest();
13
25259
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 the version of Microsoft's XML parser and that Microsoft.XMLHTTP refers to the latest installed version. This makes me wonder why sites like <http://developer.apple.com/internet/webcontent/xmlhttpreq.htmlopt to use Msxml2.XMLHTTP, first, and...
3
2587
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 (window.XMLHttpRequest) {
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.