Sunday, May 19, 2024
20
rated 0 times [  26] [ 6]  / answers: 1 / hits: 111288  / 15 Years ago, fri, may 15, 2009, 12:00:00

I'm using IE 8 on Vista, and everytime I change a javascript file and then start debugging, I have to hit Ctrl+F5 to have it reload my javascript. Is there any way to make it automatically reload javascript when I start debugging, but not lose the performance gains when just browsing the net?



Yeah yeah I know you probably don't like IE, but keep in mind the question isn't What's the best browser?.


More From » internet-explorer

 Answers
9

Add a string at the end of your URL to break the cache. I usually do (with PHP):



<script src=/my/js/file.js?<?=time()?>></script>


So that it reloads every time while I'm working on it, and then take it off when it goes into production. In reality I abstract this out a little more but the idea remains the same.



If you check out the source of this website, they append the revision number at the end of the URL in a similar fashion to force the changes upon us whenever they update the javascript files.


[#99529] Monday, May 11, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hasanb

Total Points: 321
Total Questions: 102
Total Answers: 96

Location: Burkina Faso
Member since Fri, Sep 4, 2020
4 Years ago
;