TabUnder Code



This script will open a new popunder window for virtually any outbound link. The destination URL opens in a new window and the original web page redirects to the link specified in the code.

Copy and paste the JavaScript below into the HEAD section of your website or body of a landing page. Replace google.com with any website you want for the popunder window.



<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $('a').click(function(e) {
            var id = $(this).data("windowid");
            if(id == null || id.closed) {
                id =  window.open($(this).attr("href"), '_blank');
            }
            id.focus();
            $(this).data("windowid", id);
            e.preventDefault();

            setTimeout(function() {
                   window.location.href = "https://google.com"; //will redirect to any landing page
                }, 1000); //will call the function after 1000 millisecond. (1000 = 1 second)

            return false;
        });
    });
</script>

-----------------------------------------------------------------------------------