[英]Credit card validation with not working in Wordpress
I am using jQuery Credit Card Validation Plugin: Smart Validate to validate credit cards. 我正在使用jQuery信用卡验证插件: 智能验证来验证信用卡。
It is working fine, when downloaded it and implemented in my localhost. 下载并在我的本地主机中实现后,它工作正常。
But when I tried to implement the same in wordpress it is not working and when I checked the console I am getting: 但是,当我尝试在wordpress中实现相同功能时,它不起作用,并且当我检查控制台时,我得到:
TypeError: jQuery(...).ccvalidate is not a function
jQuery('.cc-container').ccvalidate({ onvalidate: function(isValid) {
Why its not working with wordpress? 为什么它不能与wordpress一起使用? How can I resolve the issue? 我该如何解决该问题?
In the fiddle you can see the normal working and there it is working fine. 在小提琴中,您可以看到正常的工作,并且工作正常。
Wordpress has jquery has jQuery.noConflict();
Wordpress有jquery有jQuery.noConflict();
enabled, this means that the use of the $()
shorthand doesn't work by default. 启用,这意味着默认情况下, $()
速记的使用不起作用。 You could try wrapping the entire code in ()(jQuery);
您可以尝试将整个代码包装在()(jQuery);
(or just change all the $()
's to jQuery()
). (或只是将所有$()
更改为jQuery()
)。 See Wordpress codex for more information. 有关更多信息,请参见Wordpress Codex 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.