Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f82dc7d

Browse files
committed
add 'target', '_blank'
1 parent d951410 commit f82dc7d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

_layouts/default.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212

1313
{% include footer.html %}
1414

15+
function addBlankTargetForLinks () {
16+
$('a[href^="http"]').each(function(){
17+
$(this).attr('target', '_blank');
18+
});
19+
}
20+
21+
$(document).bind('DOMNodeInserted', function(event) {
22+
addBlankTargetForLinks();
23+
});
24+
1525

1626
<!-- Image to hack wechat -->
1727
<img src="/img/icon_wechat.png" width="0" height="0" />

0 commit comments

Comments
 (0)