473,327 Members | 1,997 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,327 software developers and data experts.

ajax - dynamic update

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?

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

Nov 6 '07 #1
3 1602
Well, if that's the idea, then you shall probably have to have a
daemon-like
server-side process, that won't stop working after your request
ends.You would
then have two kinds of requests:
- Start the search (delivering parameters); the server side process
starts the search, request ends, process continues to work.
- Give me results found so far (probably put in a database or a
filein the meantime)
In my opinion, this isn't so bad, but requires having the privilege
ofresident processes, written
in whatever language, probably c or c++, which is rarely seen
fromhosting providers these days -
you would probably have to use your own computer or rent a
virtualdedicated or dedicated server
which is pretty expensive (e.g. several hundred Euros per month).
Hi Darko, thanks for your reply. I don't think it is that difficult.
Ajax is asynchronous, that's what it is all about. I can make one
request to start the search. The callback for that request will tell
me when the search has finished. In the meantime, results are added to
a database, entries tagged with the session id.

And then I can make intermediate requests to gather results so far.
The callback of the first request will stop these intemediate requests
being made.

What do you think? Steffen
--

I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo

Nov 13 '07 #2
On Sun, 25 Nov 2007 09:17:10 GMT, "rf" <rf@invalid.comwrote:

I have tried it. I used setInterval with 10 seconds, and tested for
readyState=3. Instead of printing out the responseText, I printed the
current time and the number of lines in responseText:

14:54:22:: 821
14:54:31:: 1973
14:54:41:: 3465
14:54:51:: 6076
14:55:01:: 8314
14:55:11:: 10552
14:55:21:: 12790
14:55:31:: 15028
14:55:41:: 17639
14:55:51:: 19877
14:56:01:: 21937
14:56:11:: 24331
14:56:21:: 27067
14:56:31:: 29119

You can see how responseText gets longer with every call.

I have tested on Mac:

Firefox Yes
Opera Yes
Safari Yes

and Windows:

Firefox Yes
Opera Yes
IE No

Unfortunately I couldn't test on Linux.

I have also tried to get away from setInterval, and use the
onReadyStateChange event. This is indeed fired several times in
Firefox, but not the other browsers.

Hope IE support this readyState = 3 soon, otherwise, what is the point
of it?

Cheers
Nov 27 '07 #3
On Tue, 27 Nov 2007 20:57:29 GMT, Ben Gun <jo**@ibn.comwrote:
>I have tested on Mac:

Firefox Yes
Opera Yes
Safari Yes

and Windows:

Firefox Yes
Opera Yes
IE No

Unfortunately I couldn't test on Linux.
Tried Firefox on Linux now, and it worked just fine.

PS i am the OP.
Dec 3 '07 #4

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

Similar topics

9
by: darrel | last post by:
Last week I asked about ASP.net 2.0 AJAX frameworks and there appears to be several to choose from. I haven't used ASP.net 2.0 yet, but from doing a bit of reading, it appears that ASP.net 2.0...
0
by: melledge | last post by:
XTech 2006, 17-19 May, Amsterdam, The Netherlands www.xtech.org Ajax lightning demos line-up The provisional line-up for the Ajax lightning demos is now available. These will be rapid-fire...
3
by: BG Mahesh | last post by:
hi We are looking for a good Ajax library which has very good support for iframe. The ones we have considered so far are, Backbase.com - not happy with the speed Zapatech.com - it is good but...
4
by: Rob Meade | last post by:
Hi all, I played with my first bit of AJAX the other week and was pleasantly surprised that I achieved my goal..now I'd like to try something else.. Question... If I have an updatePanel,...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
0
by: Lit | last post by:
Hi, I would like to run some dynamic-JavaScript code at the end of a callback of an AJAX Call. for an update Panel 1---I click on a button on the browser, 2---AJAX method called server...
3
by: JacekDr | last post by:
Hello, I've got the following problem: I want to add and remove dynamically controls to UpdatePanel. In my user control I have a button, but when I click it I get AsyncPostback and Event for...
7
by: MikeB | last post by:
Hello All, I am new to ajax and wanted to start by trying something simple. I have a web form with an updatepanel and then inside the update panel I have a listbox. Then outside of the updatepanel...
1
by: raam | last post by:
Hi, I have ajax tab container with 6 tabs in it. I need to validate each tab contents separately and the validtaion summary must be separate for each tab. i cannot do that only one summary is...
1
by: =?Utf-8?B?TW9oc2luIEtoYW4=?= | last post by:
Hi, I am working on a website where i am creating Horizontal Menus Dynamically from database as per rights available to the user. I have several UserControls. And the Menu control also brings...
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
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.