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 Quote Link to comment Share on other sites More sharing options...
andrewgauger Posted May 13, 2010 Share Posted May 13, 2010 What about ajaxTime.php ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.