web auto reload
-
Does anyone know if there is a smal project here to show how a webpage with a data grid autoreload. A want to give the user the funktion to stop and start the autoreload and how often the reload should happend. If there is'n. can som one show me how to do this. Happy coding!
-
Does anyone know if there is a smal project here to show how a webpage with a data grid autoreload. A want to give the user the funktion to stop and start the autoreload and how often the reload should happend. If there is'n. can som one show me how to do this. Happy coding!
do you mean you want to refresh/reload the page automatically after some time span? And in some cases you want the user interaction to start or stop refreshing the page or set the time span for refreshing the page? I think on refreshing the page, datagrid will automatically reloaded from the database, right..:-D If so you can use javascript functions window.setTimeout and window.clearTimeout. The functions take milliseconds as input time, so value for one second is 1000 and one minute is 60000. Here is an example: var tiemout = 300000; // refresh the page every 5 minutes var refreshID = start(); //window.setTimeout(refreshPage,timeout); function refreshPage(); //refresh page { windoe.location.reload(); } function reset(timeval) { timeout = timeval * 60000; //assuming you will take input in minutes stop(); start(); } function stop() { window.clearTimeout(refreshID); } function start() { window.setTimeout(refreshPage,timeout); } ----- -- modified at 10:31 Friday 21st October, 2005</x-turndown>