Re: ajax - dynamic update



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 depends
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.
I could start off the search with one call, not even bothering about a
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,
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.
It is not the size of the data, but the time it will take the search.
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

.



Relevant Pages

  • Re: Ajax Asynchronous refresh. Is it possible ?
    ... For example the AJAX call could return the next action with an estimated ... sends a request to the server and the server only responds to incoming ... When a change occurs i want to refresh my page in browser by notyfinig ... is finished a browser should be refreshed to say - 'hey, your request is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: setTimeOut and atomicity
    ... > I am working on a simple chat program and want to use AJAX. ... this way a correctly written server can give near immediate response to posted ... > line" request when someone pressed the send button. ... are the onClick handler and the setTimeOut atomic? ...
    (comp.lang.javascript)
  • Re: ajax - dynamic update
    ... if this is a common or newbie question. ... I would like to request some data from a server using ajax (search ... XMLHttpRequest, similar to a news feed I could request more and more ...
    (comp.lang.javascript)
  • Re: ajax - dynamic update
    ... if this is a common or newbie question. ... I would like to request some data from a server using ajax (search ... XML is a very bulky format. ...
    (comp.lang.javascript)
  • Re: Can it be done like this (ajax)?
    ... your script wait until the request is complete. ... you don't want to do that, as server or connection problems could occur ... waiting for the response. ... responsive Ajax apps. ...
    (comp.lang.javascript)