Re: ajax - dynamic update
- From: steffen haugk <steffen.haugk@xxxxxxxxxxxxxx>
- Date: 7 Nov 2007 08:18:13 GMT
In article <1194399106.502648.182800@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Darko<darko.maksimovic@xxxxxxxxx> wrote:
On Nov 6, 3:10 pm, steffen haugk <steffen.ha...@xxxxxxxxxxxxxx>
wrote:
Hi there,
if this is a common or newbie question.
I would like to request some data from a server using ajax (search
type of thing). Whilst the server is searching, I would like to
display the first results on the client side. Ideally as they come
in.What is the best way to go about such a search?
I can imagine to write results on the serverside to a database,
which I can interrogate using ajax and add to the results through
javascript. then using ajax again look on the server if there are
newresults. This would work. Question: Is there a better way?
I'm not sure about the whole thing. Amongst other things, it dependsI could start off the search with one call, not even bothering about a
on respond format. If it is XML, which I would recommend, having
Javascript deliver builtin support for it, then you can't parse
itbefore the whole document is received.
result. Then I could periodically check for results with an
XMLHttpRequest, similar to a news feed I could request more and more
results, until the search has finished. RSS is using XML. But I am not
bothered about the format.
Also, how big your data is? If it is so big that it's worth doing,It is not the size of the data, but the time it will take the search.
then are you sure you want to display it all on one page. And when I
say "so big" I mean, say, more than 100k. If it's less than
that,that'll probably come in one piece and be used only rarely, with
slow
connections.
Maybe I shouldn't use the term 'search', think of the result as
solutions. The solutions might take some time to calculate, and as the
soltions are coming in, I would like to show them on the client side,
so the user doesn't have to wait until everything is finished. In
fact, the user could stop the generation of solutions by sending a
request to the server.
As an example have a look at
<http://www.eurobuch.com/index.php?lang=e>
you can search for books in second hand bookshops all over the world.
As the results are coming in, they are added to the list. There is
also a progress bar, and a line that displays the number of results.
That's what I have in mind. I am wondering if there is a standard way
of doing it.
Thanks, Steffen
--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo
.
- Follow-Ups:
- Re: ajax - dynamic update
- From: Darko
- Re: ajax - dynamic update
- References:
- ajax - dynamic update
- From: steffen haugk
- Re: ajax - dynamic update
- From: Darko
- ajax - dynamic update
- Prev by Date: Re: Preloading images
- Next by Date: Re: Preloading images
- Previous by thread: Re: ajax - dynamic update
- Next by thread: Re: ajax - dynamic update
- Index(es):
Relevant Pages
|