简体   繁体   English

jQuery Cookie插件未在Wordpress中加载

[英]Jquery Cookie plugin doesn't load in wordpress

I've got a wordpress site with jquery cookie plugin installed. 我有一个安装了jquery cookie插件的wordpress网站。 It used to work fine. 过去工作正常。 For a little while, i've been working with a content that didn't require the plugin. 有一段时间,我一直在使用不需要插件的内容。 Meanwhile, i've started using cloudflare. 同时,我已经开始使用cloudflare。

Today, I tried adding content that utilizes that plugin, and suddenly got an error saying "Uncaught TypeError: $.cookie is not a function". 今天,我尝试添加利用该插件的内容,突然出现一个错误,提示“未捕获的TypeError:$。cookie不是一个函数”。

Obviously, the plugin is not loading. 显然,该插件未加载。 What i've done first is, i've moved that plugin from a separate file into header. 我首先要做的是,将该插件从一个单独的文件移到了标头中。 Right above the script that utilizes it. 在利用它的脚本的正上方。 No luck. 没运气。 I figured, it could still be showing cloudflare cached version, so, i've deleted cache and minified scripts & css. 我认为,它仍然可能显示cloudflare缓存的版本,因此,我删除了缓存并缩小了脚本和CSS。 Still no luck. 仍然没有运气。 And now I'm stuck. 现在我被卡住了。

I know that people here like some code to be provided, but as you can understand, there is a lot of it. 我知道这里的人喜欢提供一些代码,但是正如您所了解的那样,有很多代码。

Is it possible that $.cookie is being called before it is loaded? $ .cookie是否有可能在加载之前被调用? Or that CloudFlare force the loading of a jQuery asset whose version isn't compatible with your cookie plugin? 还是那个CloudFlare强制加载版本与您的Cookie插件不兼容的jQuery资产?

Looks like disabling cloud flare took a while. 好像禁用了云状光晕花了一段时间。 Works fine now. 现在工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM