ahairshi
ahairshi

Reputation: 381

Parent Refresh - JavaScript

I use the below JS to refresh Parent page, but I am getting the below message

Code:

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

Please help me how to avoid this

enter image description here

Upvotes: 1

Views: 349

Answers (1)

Minko Gechev
Minko Gechev

Reputation: 25672

You can avoid using POST before refresh is required or set the location property instead of using reload:

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

One more option is to redirect the parent page directly after the post request is done. After that the child can refresh the page without the popup.

Upvotes: 1

Related Questions