Auto refresh on specific pages and with constant time of 5 sec
I have 3 file as following :
- output-xml.php
- phpsqlajax_map.htm
- da开发者_Python百科tabase.php
In order to get the latest information on phpsqlajax_map.htm, I have to refresh "3" and then no "1" first. For user,thy will only open phpsqlajax_map.htm, while 1 and 3 only work behind the system.
What I want to ask is, how to write a javascript in order to make 1 and 3 refresh automatically in every 5 second and " even without opening it out ". Hope u all understand my poor english.
You could use the window.setInterval function which allows you to execute some custom javascript method at regular intervals. This method could send an AJAX request and refresh the corresponding DOM element.
精彩评论