Author Topic: How to clear cached CSS in Firefox  (Read 18439 times)

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28695
  • Always on vacation
    • Jenkin Hill Internet
How to clear cached CSS in Firefox
« on: October 05, 2010, 17:36:03 PM »
CSS caching can be a problem when testing style changes on a web page using Firefox. To ensure you clear any cached css in Firefox make a new bookmark (any will do) in the browser, right click on the bookmark link and replace the Location: with the following code:

Code: [Select]

javascript:void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i<a.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href)%20{var%20h=s.href.replace(/(&|%5C?)forceReload=d+/,'');s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}})();


To clear css while viewing a web page, just click on the bookmark. The page refreshes having reloaded css from the server.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.22 10858  J 3.10.11 PHP 8.0.27