Solved

Best way for a browser to periodically check for changes in a database table?

Posted on 2008-10-22
3
173 Views
Last Modified: 2012-05-05
I have a website where job details are entered into a database. A program from a backend server grabs these details and tries to price it... when this is done it changes the status field of the job to 'priced'. This may take 30sec so the browser needs to continuously check the database for a 'priced' value.

At the moment we have a javascript function that re-loads the page every 2 seconds, which causes the page to check the status of the field every time. If the status field becomes 'priced' within 30sec then it'll continue. Otherwise it'll say job cannot be priced.

Does anyone know a more effective way of doing this with AJAX for example... or at least point me in the right direction.

Thanks.



0
Comment
Question by:robaherne
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
crazyman earned 500 total points
ID: 22777945
Use an ajax update panel and reload it every x seconds.

http://encosia.com/2007/07/25/display-data-updates-in-real-time-with-ajax/
0
 
LVL 13

Assisted Solution

by:crazyman
crazyman earned 500 total points
ID: 22777966
0
 

Author Closing Comment

by:robaherne
ID: 31508796
Great stuff! Thanks a lot!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question