1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Please Help

Discussion in 'HTML & JavaScript' started by willrey619, Oct 14, 2015.

Tags:
  1. willrey619

    willrey619 Newbie

    Joined:
    Mar 29, 2013
    Messages:
    13
    Likes Received:
    0
    Hi,

    Whenever someone leaves my site by clicking on a link to another site on my website the link opens in a new tab on desktop or a new window on mobile. I was wondering when that new tab opens whether once there not viewing the old tab it could go onto another page automatically, like a thank you page with the social media links.

    Hope that makes sense,

    Thanks
     
  2. zotohost

    zotohost Registered Member

    Joined:
    Oct 25, 2015
    Messages:
    71
    Likes Received:
    4
    I don't think so opening new tab is possible as most browsers hate this. This is some sort of popup.
     
  3. revproxy

    revproxy BANNED BANNED Jr. VIP Premium Member

    Joined:
    Nov 20, 2015
    Messages:
    396
    Likes Received:
    100
    Gender:
    Male
    try too add a js listener to all links, on the click check if its a external website and open new window with opener.
    becouse you got user action you got permission to open new window:
    HTML:
    // just draft
    $("a").click(function(){
    if ($(this).attr("target") == "blank") {
    var win = window.open("http://youlink", '_blank');
    win.focus();
    }
    });