How to force IE to reload javascript?

后端 未结 10 1382
清酒与你
清酒与你 2020-12-12 20:41

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

10条回答
  •  一个人的身影
    2020-12-12 21:22

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

    
    

    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.

提交回复
热议问题