I want my external links to open in a new tab

If you only wanted to do this for specific links, you could simply embed a tag in the href and look for the tag.

For example; say I decide to use: ?xgtab& as an indicator to open the page in an [External Giani Tab]

and then just use a more advanced selector:

$( "a[href*='?xgtab&']" ).attr("target","moredetail");

This will embed the xgtab arg in the request - but I doubt that will cause a problem if you choose a tag that is unlikely to be used by the websites you are linking to.

4 Likes