All External html links to open new browser window

Home Forums Porto – Responsive HTML5 Template All External html links to open new browser window

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10005234
    rascasse
    Participant

    I am using a full width page template and have many external links (http://www…. etc) and want them all to open in a new browser window.

    Is there a recommended way of doing this for the whole html page without inserting target=”_blank” in every single <a href=” link ?

    Thank you


    #10005246
    Support
    Keymaster

    Hello,

    My suggestion is that you add a custom script:

    (js/custom.js)

    $(document).ready(function() {
    	$("a[href^='http']").attr("target", "_blank");
    });

    As you can see, all the links that starts with http will automatically have the target set.

    Make sure that the internal links doesn’t have those.

    Let me know if you need further assistance.

    Kind Regards, Jonas


Viewing 2 posts - 1 through 2 (of 2 total)

This topic is marked as "RESOLVED" and can not rceive new replies.