我在任何地方都找不到这个。熟悉 MailChimp 的人可以提供建议吗?
我已经嵌入了我的表单/输入,并且有一些空的 div(如下),其中注入了错误/成功消息。
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
当我将自定义文本添加到空 div 时,它只会在提交表单时被覆盖,因此它显然以某种方式/在哪里从 MailChimp 获取内容!
有任何想法吗?
一种编程方法是使用一些 javascript:
// select the target node
var target = document.getElementById('mce-success-response');
// create an observer instance
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (target.innerHTML === "Thank you for subscribing!") {
target.innerHTML = "Check your email!";
}
});
});
// configuration of the observer:
var config = { attributes: true, childList: true, characterData: true };
// pass in the target node, as well as the observer options
observer.observe(target, config);
得到该代码here https://stackoverflow.com/questions/39221775/trigger-for-span-text-html-on-changed.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)