decentralized-id.github.io/assets/js/mod_outer_links.js

11 lines
331 B
JavaScript
Raw Normal View History

2019-04-07 16:41:18 -04:00
$(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");
}
});
});