[Javascript] Auto reloading JS files on change?

Skip Evans skip at bigskypenguin.com
Wed May 28 19:39:22 CDT 2008


Hey all,

I have the following in an HTML file that is 
echo'd to the browser via PHP code.

<script src="ajax/players.js" 
type="text/javascript"></script>

But whenever this, and other, .js files are 
modified the user must know to hit the refresh 
button on his browser.

I've been looking for a way to reload the JS files 
on changes, and I've come across the last-modified 
header element, but not sure how to implement this.

Of special note here is that the HTML file is read 
via PHP and then sent to the browser with a

echo $html

...call. Can someone point me in the right 
direction here?

Thanks!
-- 
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison, WI 53703
608-250-2720
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and versatile
PHP/MySQL, AJAX & DHTML development framework.
http://phpenguin.bigskypenguin.com/



More information about the Javascript mailing list