jQueryで外部リンクを別タブで開く
//http:で始まるリンク先に、自動的に target="_blank" を追加します。
$(function(){
$("a[href^='http://']").attr("target","_blank");
});
//自サイトのホスト名を含まないリンクを対象にする場合
$(function() {
$("a[href^=http]:not([href*='" + location.hostname + "'])"
).attr("target", "_blank");
});