hasjem Posted May 13, 2010 Share Posted May 13, 2010 i picked this up from the internet, it is simple, but not working. why not? <div align="center" id="timeval">--:--:--</div> <button id="stop">Stop</button> <script src="jquery.js"></script> <script> $(document).ready(function() { //ajaxTime.php is called every second to get time from server var refreshId = setInterval(function() { $('#timeval').load('ajaxTime.php?randval='+ Math.random()); }, 1000); //stop the clock when this button is clicked $("#stop").click(function() { clearInterval(refreshId); }); }); </script> and as ajaxtime.php: <?php echo date("g:i:s A"); ?> and, yes, i uploaded jquery.js what is wrong? thanx lex Link to comment https://forums.phpfreaks.com/topic/201619-setinterval/ Share on other sites More sharing options...
andrewgauger Posted May 13, 2010 Share Posted May 13, 2010 What about ajaxTime.php ? Link to comment https://forums.phpfreaks.com/topic/201619-setinterval/#findComment-1057737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.