2013-01-17 24 views
1

我用下面的JS刷新父頁面,但我得到了以下信息家長刷新 - JavaScript的

代碼:

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

請幫助我如何避免這種

enter image description here

+0

試試'window.opener.document.location = window.opener.document.location;' –

+0

這意味着原始頁面是通過POST請求加載的,因此當您嘗試刷新時會得到警告信息 – cowls

回答

1

在需要刷新或者設置位置屬性而不是使用reload之前,您可以避免使用POST

window.opener.document.location = window.opener.document.location; 

還有一種選擇是在post請求完成後直接重定向父頁面。之後,孩子可以在沒有彈出窗口的情況下刷新頁面。