Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  10] [ 4]  / answers: 1 / hits: 18082  / 13 Years ago, wed, february 22, 2012, 12:00:00

I have a bookmarklet that keeps using cache versions of http://www.imvu-e.com/products/hpv/download/HPV.js. I want it to never cache it and always reload it.



This is the hyperlink I use to save the bookmarklet (which users drag to browser toolbar that installs it):



<a href=javascript:(function(){
c = document.createElement(&quot;script&quot;);
c.type = &quot;text/javascript&quot;;
c.src = &quot;http://www.imvu-e.com/products/hpv/download/HPV.js&quot;;

c.onload = c.onreadystatechange = function() {
if ( ! (d = this.readyState) || d == &quot;loaded&quot; || d == &quot;complete&quot;){
document.documentElement.childNodes[0].removeChild(c);
version='beta';
}
};
document.documentElement.childNodes[0].appendChild(c);
})();>Run HPV</a>

More From » caching

 Answers
10

Add a useless querystring to the end of your url:



c.src = http://www.imvu-e.com/products/hpv/download/HPV.js? + (new Date).getTime(); 

[#87290] Tuesday, February 21, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarvisjovannia

Total Points: 127
Total Questions: 123
Total Answers: 101

Location: Netherlands
Member since Mon, Jun 7, 2021
3 Years ago
;