Hard page refresh using Javascript

I have a question: I open a popup using javascript, then a popup appears, there I make changes to the css file, when I click the Close button, the following javascript open page is used to refresh the window

window.opener.location.reload();
window.close();

But css remains cached in the browser, after the next update it only disappears. Is there a way that I can hard update the open page using javascript?

+3
source share
3 answers

Try adding the parameter to the URL of the CSS file:

mystyles.css?12345

Most browsers do a complete reload of URLs with parameters.

But make sure you delete this when your site goes online!

+2

: MDC - window.location

(forceget)

URL. forceget - , , , , . , p → .

+5

Try the following:

window.opener.location.href=window.opener.location;
window.close();
+1
source

Source: https://habr.com/ru/post/1721970/


All Articles