Howto: Create Links within HTML Widgets (iframes) that open webpages in the same window

If you have a webpage within an HTML widget, and you click a link within that Widget, the webpage will open within that same frame.

To fix this, change your links in your widget to use the _parent attribute for the target property.

<a href="http://site.com" target="_parent">Link to my site</a>

The other options for the ‘target’ attribute are below:

_blank Opens the linked document in a new window or tab

_self Opens the linked document in the same frame as it was clicked (this is default)

_parent Opens the linked document in the parent frame

_top Opens the linked document in the full body of the window

_framename_ Opens the linked document in a named frame.

2 Likes