【发布时间】:2018-04-01 14:10:24
【问题描述】:
我试图在单击一个元素时打开我的 mailchimp 弹出窗口,但我什么也没看到。我关注了this answer,但它对我不起作用。当我单击我的元素时,我可以看到网络设置中发生了一些事情。当我控制台记录某些内容时,它会在我单击元素时显示,因此 js 工作正常。该问题/答案已有 2 年历史,所以 mailchimps 方面可能发生了一些变化?
我现在的代码:
我的元素:
<a style="width:100%;margin-top:20px;margin-bottom:20px;" href="javascript:void(0);" id="ctabutton" class="ctabutton ctabuttonmobiel open-popup kl-cta-ribbon" title="VRAAG EEN SCHERPE OFFERTE AAN"><strong>INSCHRIJVEN VOOR DE NIEUWSBRIEF</strong><svg version="1.1" class="trisvg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" preserveaspectratio="none" width="14px" height="5px" viewbox="0 0 14.017 5.006" enable-background="new 0 0 14.017 5.006" xml:space="preserve"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.016,0L7.008,5.006L0,0H14.016z"></path></svg></a>
我的js代码:
function showMailingPopUp() {
require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us16.list-manage.com","uuid":"fab44298b45bd02e4d7427594","lid":"23ebf55005"})})
document.cookie = "MCEvilPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
};
jQuery(function() {
jQuery(".open-popup").on('click', function() {
showMailingPopUp();
});
});
【问题讨论】:
标签: javascript jquery mailchimp