问题
I am using WordPress. I have to display the Mailchimp subscribe popup on click on the button.
I found some URL
https://medium.com/@rekommend_io/mailchimp-pop-up-based-on-click-a0975374c804
https://gist.github.com/scottmagdalein/259d878ad46ed6f2cdce
MailChimp - show modal sign up form popup on button click
Also Sharing same code here
<ul><li class="open-popup"><a href="#">Subscribe to our mailing list</a></li></ul>
<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() {
//alert("hello");
require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us20.list-manage.com","uuid":"bd7ed5583d8f567d56a2ed5ec","lid":"007366445e","uniqueMethods":true})})
document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
};
$(function() {
$(".open-popup a").on('click', function() {
showMailingPopUp();
});
});
</script>
But my popup not displayed after clicking on.
来源:https://stackoverflow.com/questions/59424600/how-to-display-the-mailchimp-subscribe-popup-form-on-click