1
我用下面的JS刷新父頁面,但我得到了以下信息家長刷新 - JavaScript的
代碼:
window.opener.document.location.reload();
window.close();
請幫助我如何避免這種
我用下面的JS刷新父頁面,但我得到了以下信息家長刷新 - JavaScript的
代碼:
window.opener.document.location.reload();
window.close();
請幫助我如何避免這種
在需要刷新或者設置位置屬性而不是使用reload
之前,您可以避免使用POST
:
window.opener.document.location = window.opener.document.location;
還有一種選擇是在post
請求完成後直接重定向父頁面。之後,孩子可以在沒有彈出窗口的情況下刷新頁面。
試試'window.opener.document.location = window.opener.document.location;' –
這意味着原始頁面是通過POST請求加載的,因此當您嘗試刷新時會得到警告信息 – cowls