ipradhansk
ipradhansk

Reputation: 352

Reload Parent's Parent in Javascript?

How do we reload parent's parent in JavaScript?

I tried the following code but it didn't seem to work:

<script>
    function closeOnRejectSuccess(){
        window.opener.parent.location.reload();
    }
</script>

Upvotes: 1

Views: 1312

Answers (2)

Rahul Tripathi
Rahul Tripathi

Reputation: 172458

Yuo may try this:

function closeOnRejectSuccess(){
    window.opener.opener.location.reload();
}

Upvotes: 3

T.J. Crowder
T.J. Crowder

Reputation: 1074435

It depends on what the relationship is, either what you have (if your opener is a frame) or

window.opener.opener.location.reload();
//           ^^^^^^^

...if it's also been opened.

Upvotes: 1

Related Questions