Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
109
rated 0 times [  115] [ 6]  / answers: 1 / hits: 41704  / 14 Years ago, wed, january 12, 2011, 12:00:00

I'm working on JavaScript for a site, developing with Firefox, and when I refresh the page, I don't see my changes. The JavaScript file is in an external file. I reloaded and refreshed the page several times, but the old JavaScript file was still cached. Finally, I loaded the JavaScript page in the browser directly, saw the old script, hit 'reload', and saw my changes.



How can I clear cached external JavaScript files? I'll need to know this also when I tell the client that the changes are made, so that they aren't seeing the old cached functionality.


More From » firefox

 Answers
42

In Firefox you can install a plugin called Web Developer Toolbar which has a appcache clear command



I think there is no way to do it programmatically but you could give a hint to the browser using something like



<script type=text/javascript src='js/my.js?x=<?php echo rand(0,100) ?>'></script>

[#94253] Tuesday, January 11, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mireyag

Total Points: 73
Total Questions: 107
Total Answers: 85

Location: Ukraine
Member since Sun, Dec 13, 2020
3 Years ago
mireyag questions
Sun, Aug 15, 21, 00:00, 3 Years ago
Wed, Dec 16, 20, 00:00, 3 Years ago
Tue, Sep 1, 20, 00:00, 4 Years ago
Sun, Jul 5, 20, 00:00, 4 Years ago
;