问题
I am using WordPress. I have to display the Mailchimp subscribe popup on click on the button.
I tried below code but it's not displaying my popup. I checked on google and SO, I found some solution but that is not working.
Would you help me out with this?
<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>
Can anyone help me out here?
来源:https://stackoverflow.com/questions/59607025/how-to-display-the-mailchimp-subscribe-popup-form-on-click