Friday, August 17, 2018

How to open iframe external link in parent window

To open a link in the parent window inside a Iframe you can use the one of the below methods:

  1. If We wants all the link to open in the parent window then use the below tag in the header:
    <head><base target="_parent"><base></head>
     
  2. We can also use the tag target="_parent" in <a href="aboutus" target="_blank"/> tag
     
  3. We can also use javascript

    parent.document.location.href = "http://example.com";

No comments: