Search This Blog

Thursday, May 16, 2019

Redirect parent window from an iframe action uisng Javascript

Welcome to  designer dairy blog, here we are going to  discuss how to Redirect parent window from an iframe action


Example.html is the main page and  we are loading "example1.html" via an iframe tag.

Example.Html Mark-up

<iframe src="Example1.html"> </iframe>


Example1.html  we have a button "Click Me", once the button is clicked, we have to redirect to url "".

So we have to use  to redirect parent window from an iframe action.

Html Mark-up - Example2.html

function changeurl()
{ = "";

<a href ="#"  id="accept" onclick="changeurl()"> Click Me </a>


If your not using iframe tag, then u can use window.location.href to redirect parent window.


Thanks for reading the article.Stay Tuned on  for more updates on Javascript.

No comments:

Post a Comment

Learn Promise async await in Javascript

<!DOCTYPE html> <html> <body> <p>This example uses the addEventListener() method to attach a click event to a b...