Display new record every 5 seconds
Hi to everybody,
i've a page that display one product from a table (db access), i need to change the record displayed every 5 seconds without reboot the page.
Thank you very much.
Another way is to use Ajax for this.
Any tutorial or guide for it?
On the web there are several good tutorials on starting with ajax.
Try searchin on theme.
I think I have some good code examples of ajax. But I have to look for them.
thanks, i've already done something with ajax + php and ajax + cf , i'm looking for a tutorial if anybody knows, that explain my task.
I just need a box in a page that refresh every 5 seconds taking every times a new record from the db.
Hope somebody can help me.
you will need to do something like
a bit primitive .. but it is to get an idea ..
var counter = 1;
// Use ajax here to call another page which will take as parameter counter
// and will return the appropriate record (as rendered html) from the database
// something like
Ajax.get("dbreader.php?counter=" + counter, callbackfunction_once_ajax_completes);
// get the response from the ajax
// and display it in the html
var contents = <the response from the ajax object>;
var mydiv = document.getElementById("theIDofyourDIV");
mydiv.innerHTML = contents;
Last edited by gabriele; 07-04-2008 at 01:30 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)