简体   繁体   English

Jquery“对象没有方法”

[英]Jquery “Object has no method”

I've noticed this question has been answered in relation to various developers jquery installations, however i have come across this error and i am trying to figure out what is conflicting/causing this error message to occur in my script. 我已经注意到这个问题已经解决了与各种开发人员jquery安装有关,但是我遇到了这个错误,我试图弄清楚什么是冲突/导致我的脚本中出现此错误消息。 I have made attempts to install a jQuery carousel onto my site which i have used before on pervious sites, however something within my code is preventing this carousel to work. 我已经尝试在我的网站上安装一个jQuery轮播,我之前在以前的网站上使用过,但是我的代码中有些东西阻止了这个轮播工作。 Does this have something to do with the HTML 5 boilderplate prototype? 这是否与HTML 5 boilderplate原型有关?

Is there anyone out there that can pin-point this issue? 那里有没有人可以指出这个问题?

Click here 点击这里

the issue that you have is jQuery is not defined because you load it at the end of the document, and it should be the first to load before any jQuery plugins 您遇到的问题是jQuery is not defined因为您在文档的末尾加载它,它应该是第一个在任何jQuery插件之前加载

in other word, this 2 scripts : 换句话说,这2个脚本:

<script src="js/vendor/modernizr-2.6.1.min.js"></script>
<script src="js/ResponsiveSlides.js"></script>

must be after 必须在之后

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>

ResponsiveSlides.js depends on jQuery. ResponsiveSlides.js依赖于jQuery。 This should be loaded after jQuery 这应该在jQuery之后加载

Leave Modernizr in the head. 将Modernizr留在头脑中。 Per their site: 根据他们的网站:

"The reason we recommend placing Modernizr in the head is two-fold: the HTML5 Shiv (that enables HTML5 elements in IE) must execute before the body, and if you're using any of the CSS classes that Modernizr adds, you'll want to prevent a FOUC." “我们建议将Modernizr置于头部的原因有两个:HTML5 Shiv(在IE中启用HTML5元素)必须在正文之前执行,如果你使用的是Modernizr添加的任何CSS类,你将会想阻止一个FOUC。“

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

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