growth hormone

How to Make all Links Within an iframe or Google Gadget Open in a New Window

Just made a Google gadget from the Twitter widget code and realized that all the links were opening within the Google gadget iframe.

This is no good. A quick and dirty solution for this…

If you need to have all links within an iframe or Google gadget use “base target”.

To do this you will need to add a head section to your gadget immediately after the “[CDATA[” part and add the “base target=”_blank”

basetarget

This will in most cases take care of the problem and make all links inside that iframe or Google gadget open up in a new window.

Related posts:
Friendster Announces Open Social and Multi Lingual Mobile
Google Gadget Canvas / Portability Strategy
Matt Cutts of Google Discusses Links and Widgets

3 Responses to “How to Make all Links Within an iframe or Google Gadget Open in a New Window”

  1. blither Says:

    Why are u the only one posting this as a solution…Possible SEO strategy in itself…
    ummm
    cause it doesn’t work

  2. Amit Says:

    This is really nice info.Thanks for such a wonderful post.

  3. ss goh Says:

    Man, you are superb.
    One line of code is all that is needed to open a link in a new window from within an iframe.
    The other people offering solutions got me on a wild goose chase and no straight forward solution.
    Your’s the best.
    Very grateful web developer here in Singapore.
    SS Goh

Leave a Reply

Note: Please use your name, not keywords. Example: your name is like Sue or Bob, not "SEO Chicago" If your user name is keywords I will delete the link. No spam please.