Re: Reloading changes JS files?
| From: | Jim Lucas | Date: | Thu, 29 May 2008 02:48:18 +0000 |
| Subject: | Re: Reloading changes JS files? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274795@lists.php.net to get a copy of this message | ||
Skip Evans wrote:
Hey all, I have an HTML template file I read into a PHP script and then after supplying dynamic data I send the template to the browser with echo $html; The HTML template contains many JS files in the <head>...</head> section referenced like this: <script src="ajax/players.js" type="text/javascript"></script> My question is this: how can I cause the JS files on the header.html file to be reloaded to the browser when ever they have been modified? I'm looking now at the last-modified header stuff, but not sure this will do what I want. I'll keep reading up on this, but if someone can point me in the right direction that would be great.In a past project we had the same type of problem, but with jpegs. The solution was to add the unix modification time to the src path <img src='/image/bulk.jpg?112344324' /> anything after the question mark will get ignored by the browser. Except that the browser will think that it is a new URL that it has never seen before and it will call to the server for a fresh copy of the file. Jim Lucas