Solved

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

Posted on 2008-10-22
3
172 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
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…

839 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