MailChimp jQuery冲突 [英] MailChimp jQuery Conflict

查看:130
本文介绍了MailChimp jQuery冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有最大的时间将MailChimp整合到我正在设计的网站中。

I've been having the most AWFUL time integrating MailChimp into a site I'm designing!

问题是,验证不适用于嵌入式订阅表单。而不是内联错误消息,表单正在踢用户到MailChimp注册页面以纠正错误或确认列表选择。

The problem is that validation is not working for the embedded subscribe form. Instead of inlining error messages, the form is kicking the user over to the MailChimp signup page to correct errors or confirm list opt in.

我已经做了大量的定制到代码,所以不幸的是回到默认不是一个选项。

I've done a heavy amount of customization to the code, so unfortunately going back to the default is not an option.

这是我得到的错误,但我是一个JS n00b,所以我不知道他们的意思:

Here are the errors I'm getting, but I'm a JS n00b so I don't know what they mean:

打破错误mce_jQuery未定义:

Break on Error mce_jQuery is not defined:

我不认为这是一个可以通过控制台捕获的错误,

I don't think it's an error that can be caught with the console though.

奇怪的是这个。如果我剔除了自定义代码,并且只是发布MailChimp的静态代码,它以某种方式工作,但我已经复制了所有相关的代码与重要的功能,仍然没有骰子。

The weird thing is this. If I rip out the custom code and just post the static code from MailChimp it somehow works, but I've copied all the relevant code with important functions and still no dice.

您可以通过以下网址查看该网站: http://ranya.net/wp/contact

You can view the site live at: http://ranya.net/wp/contact

MailChimp列表注册位于右上角的滑动下拉列表中。相关脚本在div#top_mailing之后嵌入。

The MailChimp list signup is in the top right corner sliding dropdown. The relevant scripts are embedded just after div#top_mailing.

推荐答案

Alec Smart的答案是ALMOST正确。通过在NoConflict模式下运行jQuery,问题已经解决了。 Alec建议我添加jQuery.noConflict();在文档的标题中。事实证明,MailChimp嵌入代码中有一行被注释掉。为了正确启用MailChimp脚本的noConflict模式搜索

Alec Smart's answer was ALMOST correct. By running jQuery in NoConflict mode the issue was resolved. Alec suggested that I add jQuery.noConflict(); in the header of the document. It turns out that there is a line in the MailChimp embed code that is commented out. In order to properly enable the noConflict mode for the MailChimp script search for

 //var mce_jQuery = jQuery.noConflict();

删除评论,使其看起来像这样

Remove the comment so that it looks like this

 var mce_jQuery = jQuery.noConflict();

然后你应该很好去! :)

and then you should be good to go! :)

这篇关于MailChimp jQuery冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆