ryanfilard Posted September 20, 2012 Share Posted September 20, 2012 I am making a server management program that uses a web interface. I am new to javascript, how would I make text in <div id="var">0</div> change to the contents on http://mysite.com/cpu.php every 2 seconds Link to comment https://forums.phpfreaks.com/topic/268589-get-string-and-refresh-it-on-the-page/ Share on other sites More sharing options...
Jessica Posted September 20, 2012 Share Posted September 20, 2012 Ajax. Link to comment https://forums.phpfreaks.com/topic/268589-get-string-and-refresh-it-on-the-page/#findComment-1379490 Share on other sites More sharing options...
shlumph Posted September 20, 2012 Share Posted September 20, 2012 Ajax. And might as well use a framework to make it easier for you; jQuery or Dojo Toolkit are a couple options. Link to comment https://forums.phpfreaks.com/topic/268589-get-string-and-refresh-it-on-the-page/#findComment-1379653 Share on other sites More sharing options...
codefossa Posted September 21, 2012 Share Posted September 21, 2012 With JQuery you could just use .. setInterval(function() { $("#var").load("http://mysite.com/cpu.php"); }, 2000); Link to comment https://forums.phpfreaks.com/topic/268589-get-string-and-refresh-it-on-the-page/#findComment-1379914 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.