Possible Duplicate:
jquery/ajax load new content when available
i have a table named news with 3 fields i.e (id, news, time) and i have a setInterval after every 3mints to fetch news from google or any news site ….
now i want to fetch only new rows inserted after every 5 minutes…with jquery $.ajax()…how can i do that…
do i reload the whole table or there is a way to fetch only the new ones…
Have a variable which stores the latest ID number for a returned row, and then include that in the AJAX call (having the PHP server-side script only return rows with an ID greater than it).
In the Calling Page
In the Server-Side Script being called via AJAX