Re: Controlling Server-Affinity (Was Re: ajax - dynamic update)
- From: Randy Webb <HikksNotAtHome@xxxxxxx>
- Date: Fri, 23 Nov 2007 09:22:44 -0500
steffen haugk said the following on 11/23/2007 8:48 AM:
<snip>
PS
The xmlhttprequest object has a readyState property, i wonder what 3
(Receiving) means, documentation says 'Some data has been received'.
It means some has been received. What you don't know from it is how much has been received. It could be anywhere from 0.00000001% of the request all the way up to 99.99999999999% of the request.
Is it as simple as that? I shalll investigate.
No. It is not as simple as that, but, you are on the right track.
Rather than make one request and try to determine when the first record is returned, simply make a request for the first record, when the first record is received, display it and then make a second request to the server for the rest of the request.
User makes request.
Browser request one item from the server.
Server returns one item, starts preparing the rest.
Browser gets first request back, asks for the rest.
Server returns the rest, browser displays it.
How you go about doing that depends on what method you want to use. Whether an XHR request, dynamic js files, or some other method. Personally, I think the dynamic js files would be the simplest.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.
- Follow-Ups:
- References:
- ajax - dynamic update
- From: steffen haugk
- Controlling Server-Affinity (Was Re: ajax - dynamic update)
- From: Richard Maher
- Re: Controlling Server-Affinity (Was Re: ajax - dynamic update)
- From: steffen haugk
- ajax - dynamic update
- Prev by Date: OOP var foo vs this.foo
- Next by Date: Re: IE6/7+Vista check
- Previous by thread: Re: Controlling Server-Affinity (Was Re: ajax - dynamic update)
- Next by thread: Re: Controlling Server-Affinity (Was Re: ajax - dynamic update)
- Index(es):
Relevant Pages
|