Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to prevent the browser from executing the old version of js file...

 
Sudheesh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear sirs,


I have a JSP page that includes a javascript file as given below,
<script type="text/javascript" src="../scripts/validation.js"></script>
Some times modification is needed in this included script file. After the modification, when I load the JSP page in the browser,
the old copy of the script file, which was not modified is getting executed. by the browser.

I would like to know whether any options are availabe in javascript to prevent the browser from executing the old copy that has already downloaded to the temperary interner folder(from caching)and use the modified version available with the new response...

Thank you,
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only way to do this is to rename the .js file.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Snowhite India",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
[ September 22, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adjust your browser's cache settings. Sometimes IE needs to be refreshed a few times to update the file.
 
Jayesh Lalwani
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you change your set IE setting to check for newer pages on every visit, then that will solve the problem. Although, this might slow down your pages a little bit.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic