1
0
mirror of https://github.com/kirsle/kirsle.net synced 2024-12-22 23:19:28 +00:00
kirsle.net/www/js/offsite.js

18 lines
416 B
JavaScript

/*
* Hyperlink Editor Script || Copyright 2014 Kirsle
*
* This script makes all offsite links open in a new window.
*/
$(document).ready(function() {
$("a").each(function() {
var $a = $(this);
var href = $a.attr("href");
// Detect offsite links.
if (href.indexOf("http:") == 0 || href.indexOf("https:") == 0) {
$a.attr("target", "_blank");
}
});
});