Coder Perfect

From an iframe action, redirect the parent window.


To redirect a parent window from an iframe, what JavaScript do I need to use?

yperlink that would redirect the parent window to a new URL using JavaScript or any other means.

Asked by Ali

Solution #1 = ""; 

The top-most parent Iframe will be redirected.

window.parent.location.href = ""; 

The parent iframe will be redirected.

Answered by MIP

Solution #2

I discovered that a href=”…” target=” top”>link/a> works well as well.

Answered by Ali

Solution #3 = "";

The window object of the page at the top of the frames hierarchy is referred to as

Answered by Luca Matteis

Solution #4

For me, target=” parent” worked perfectly. Simple and hassle-free!

Answered by rDroid

Solution #5

Alternatively, consider the following: (using document object)

parent.document.location.href = "";

Answered by Real Red.

Post is based on