admin管理员组文章数量:1332339
I want to load a "new" url and force a refresh on that. If I do something like this:
window.open(url,"_self");
location.reload(true);
Then the the old URL will be reloaded. If I just use "open" the cache is used.
The URL from server is the same. For example:
currentURL = "index.html#/TheOldURL";
window.open("index.html#/TheNewURL","_self");
location.reload(true);
The code would do a reload of index.html#/TheOldURL
.
Is there any way to force a reload of the page but with the new URL?
I want to load a "new" url and force a refresh on that. If I do something like this:
window.open(url,"_self");
location.reload(true);
Then the the old URL will be reloaded. If I just use "open" the cache is used.
The URL from server is the same. For example:
currentURL = "index.html#/TheOldURL";
window.open("index.html#/TheNewURL","_self");
location.reload(true);
The code would do a reload of index.html#/TheOldURL
.
Is there any way to force a reload of the page but with the new URL?
- You are going to an anchor of the same page? Then of course it will stay at the same page. – Daniel Cheng Commented Oct 19, 2015 at 14:10
- Yes, but is there a way to force a reload (with the new URL)? – user3783327 Commented Oct 19, 2015 at 14:13
2 Answers
Reset to default 4in order to force a refresh on the url, you have to mark it as a new url. this can be done by adding a unique identifier to the url. using your example:
window.open (url+"?dt="+(new Date()).getTime(),"_self");
You can have a handle on the new window and refresh that.
var childWindow = window.open(/* ... */);
childWindow.location.reload();
refresh child window from parent window
本文标签: How to open a new URL with javascript and without cacheStack Overflow
版权声明:本文标题:How to open a new URL with javascript and without cache? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742333522a2455167.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论