Created
June 7, 2017 21:55
-
-
Save miguelmota/8bba8d30a148ce0f4f001752a107237a to your computer and use it in GitHub Desktop.
MailChimp sign up popup on click + clear expire cookie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="open-popup">Sign Up</button> | |
<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script> | |
<script> | |
function showMailingPopUp() { | |
var config={"baseUrl":"mc.us5.list-manage.com","uuid":"0b1e10820775a3f...","lid":"738208..."} | |
require(["mojo/signup-forms/Loader"], function(L) { | |
L.start(config) | |
}) | |
document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"; | |
} | |
document.getElementById("open-popup") | |
.addEventListener('click', function(event) { | |
showMailingPopUp() | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello how i can expire cookie after 1 min now it's 1 year send me code please