Log in

View Full Version : how to refresh a page in javascript at each second



mehran
01-28-2011, 05:52 AM
hi i am new to javascript,
i need help,
i have an event which should be called in the if statment,when the database time and the current time are equal that event would be called,
i get bath the times but how i generate this event in javascript when both the time are matching,

if($dbtime==&currenttime){
eventhandler();
}
this would be called if it rrefresh through javascript at every second

azoomer
01-28-2011, 07:03 AM
Hi, maybe you can use this:



<script type=text/javascript>
setTimeout('document.location=document.location' ,1000);
</script>


or



<script type=text/javascript>
setTimeout('window.location=window.location' ,1000);
</script>