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

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26357
  • 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,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

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

Currently using VM3.2.4 on Joomla 3.8.1 PHP 7.0.23

Testing VM3.2.5 on J!3.8.1