有时我得到(未捕获的ReferenceError:未定义jQuery) [英] Sometimes I get (Uncaught ReferenceError: jQuery is not defined)
问题描述
有时我会收到以下错误消息
Sometime I get the following error
Uncaught ReferenceError: jQuery is not defined
但随后没有进行任何更改,我将不会收到错误消息,然后过一会儿该错误将再次开始显示.
but then without changing anything, I will not get the error, then after a while the error will start showing up again.
这是服务器问题,如何提供文件?还是我的代码中可以更改某些内容以避免这种情况发生?
Is this a server issue, of how the files are getting served? Or is there something in my code I can change to avoid this?
推荐答案
当浏览器必须重新加载该文件时,清除缓存后可能会出现该错误.您可能试图在加载jQuery之前使用jQuery运算符$
.确保先加载jQuery,然后再使用它.
You probably get that error after clearing your cache when your browser has to reload that file. You might be trying to use the jQuery operator $
before jQuery gets loaded. Make sure jQuery is loaded before anything that uses it.
这篇关于有时我得到(未捕获的ReferenceError:未定义jQuery)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!