make external links open in new tab
When a user makes a post or comment in the forum, is there an automatic way to ensure any external links they might add open in a new browser tab?
Thanks.
-
Hi Joe,
It's possible there might be a way to do this with some custom code, but there is not an out-of-the-box setting for this functionality.
-
Thanks. I did some digging around and added this to the JS script which seems to work (I need to test and make sure some more):
var links = document.links;
for (var i = 0; i < links.length; i++) {
if ( links[i].href.indexOf( "my_support_domain" ) == -1 )
links[i].target = "_blank";
}
Please sign in to leave a comment.
2 Comments