I have a question, I'm opening a pop-up window using javascript then a window pops-up, there I make changes to the css file, when I click on close the following javascript is being used to refresh the window opener page
window.opener.location.reload();
window.close();
But the css remains cached in the browser, after the next refresh this only disappears. Is there a way I can hard refresh the opener page using javascript?
I have a question, I'm opening a pop-up window using javascript then a window pops-up, there I make changes to the css file, when I click on close the following javascript is being used to refresh the window opener page
window.opener.location.reload();
window.close();
But the css remains cached in the browser, after the next refresh this only disappears. Is there a way I can hard refresh the opener page using javascript?
Share Improve this question asked Nov 5, 2009 at 9:56 ElitmiarElitmiar 37k77 gold badges182 silver badges233 bronze badges3 Answers
Reset to default 5Documentation is great: MDC - window.location
reload(forceget)
Reload the document from the current URL. forceget is a boolean, which, when it is true, >causes the page to always be reloaded from the server. If it is false or not specified, the >browser may reload the page from its cache.
Try adding a parameter to the CSS file URL:
mystyles.css?12345
Most browsers do a plete reload of URLs with parameters.
But make sure, you remove that, when your site goes into production mode!
Try the following:
window.opener.location.href=window.opener.location;
window.close();