target blank

This commit is contained in:
infominer33 2019-04-07 16:41:18 -04:00
parent c9825c6705
commit 2d74d93cbe
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,10 @@
$(function () {
// add `target="_blank"` to outgoing links.
var host = document.location.host;
$("a[href]").each(function() {
var re = new RegExp(host, "g");
if ($(this).attr("href").match(/\/\//) && !$(this).attr("href").match(re)) {
$(this).attr("target", "_blank");
}
});
});