Forum:Is there a way to place links that open in a new window? Any necessary coding?

The title says it all. I am looking for a way to open internal and external web pages in separate windows. Any help?

  — Christopher Costello    Talk    Contribs    Community    Wednesday, August 28 2024 (PST) 13:53, July 18, 2011 (UTC)


 * No, not with wikitext. With JS, however, you can use, but ultimately the browser decides what to do with that.

Ah well. Thanks anyways.--

  — Christopher Costello    Talk    Contribs    Community    15:09, July 19, 2011 (UTC)


 * @Moncho: Can you work up a simple JS routine to add  to links with a class assigned to a div around them or something? I will work on it, but you're a much better JS coder than I am.
 * @Pikapi: Dude you need to cut down your sig... it is huge!
 * -- Fandyllic (talk &middot; contr) 19 Jul 2011 10:17 AM Pacific


 * Something simple like this should be enough:

$('.newtab a').attr('target','_blank');
 * - Tjcool007 (Talk) 18:13, July 19, 2011 (UTC)


 * Indeed it is.  is the wikisyntax to go along with that.


 * So if your browser was set to open new windows it would open a window instead, right?
 * And this would how you would put it in your JS page, I think:

 function newTabLink { $('.newtab a').attr('target','_blank'); }

addOnloadHook(newTabLink);
 * -- Fandyllic (talk &middot; contr) 20 Jul 2011 10:16 AM Pacific