faqts : Computers : Programming : Languages : JavaScript : Language Core : Functions

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 26 people (35%) answered Yes
Recently 3 of 10 people (30%) answered Yes


How to refresh an include js file every 10 seconds?

Aug 18th, 2002 08:51
Bemi Faison, jake the snake,

You could simply make the entire page refresh every 10 seconds.
But if you want the existing page to remain (and perhaps do something with the refreshed js library), you need to use frames.
Using a hidden frame, you can specify a page that calls a javascript library and also refreshes itself every 10 seconds (you could do this simply using the META tag). Everytime the page refreshes itself, the js file should refresh (if it has been changed).
You would need to be mindful of targeting frames to invoke functions, with this setup. It is commonly used and quite effective at changing a page's display based on server data. Blackplanet.com uses this method, to notify members of new messages.