admin管理员组文章数量:1430562
I am using
window.open("http://something...")
to open a pop-up window which shows a PDF file with some report on it when certain ajax success gets hit. However my PDF file doesn't show the updated data every-time I open the pop-up window. If I manually hit the F5 or refresh the page it shows the updated data. I tried something like this but to no avail.
window.open("http://something...").location.reload();
How can I refresh the pop-up window everytime it loads.
I am using
window.open("http://something...")
to open a pop-up window which shows a PDF file with some report on it when certain ajax success gets hit. However my PDF file doesn't show the updated data every-time I open the pop-up window. If I manually hit the F5 or refresh the page it shows the updated data. I tried something like this but to no avail.
window.open("http://something...").location.reload();
How can I refresh the pop-up window everytime it loads.
Share Improve this question asked Aug 9, 2016 at 11:34 Bibek AryalBibek Aryal 5451 gold badge11 silver badges29 bronze badges 1- 2 pdf=window.open(); pdf.location="newurl"; – Jonas Wilms Commented Aug 9, 2016 at 11:37
1 Answer
Reset to default 2You can append a timestamp into the url to avoid the browser cache
var url = "http:/myurl/myFile.pdf?"+ Date.now();
window.open(url);
for older browsers that doesn't support Date.now() you can use new Date().getTime();
本文标签: jqueryHow to refresh a popup window using javascriptStack Overflow
版权声明:本文标题:jquery - How to refresh a pop-up window using javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745548001a2662796.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论