Ron
Ron

Reputation: 337

Print Javascript only after popup launched

I am trying to modify this exit intent popup script. I want to a line of javascript to only work if the exit intent popup is launched. The line of javascript is simple. Something like this:

<script data-cfasync="false" type="text/javascript" src="http://www.tradeadexchange.com/a/display.php"></script>

I tried placing this code inside the popup but it still works even if the popup is not launched. I wold like it to only work if the popup is launched.

Upvotes: 0

Views: 69

Answers (1)

Gabriele Petrioli
Gabriele Petrioli

Reputation: 195992

You could use the onleave callback of the plugin

Something like this

$.glue({
    onleave: function(e) {
        $.getScript('http://www.tradeadexchange.com/a/display.php');
    }
});

Upvotes: 3

Related Questions