Exit to external link js popup

Home Forums Support Exit to external link js popup

Home Forums Support Exit to external link js popup

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #190526
    Dion

    I have this js thingy…

    $("a").on("click", function() {
        if($(this).attr("href").indexOf("http://") == 0) {
            return confirm("Super long message");
        }
    });

    How, where do i put it to work?

    #190619
    Tom
    Lead Developer
    Lead Developer

    If you have GP Hooks you can place it in the wp_footer hook.

    However, it would have to look like this:

    <script>
    jQuery("a").on("click", function() {
        if(jQuery(this).attr("href").indexOf("http://") == 0) {
            return confirm("Super long message");
        }
    });
    </script>
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.