'jQuery'未定义IE8

时间:2012-07-19 12:58:56

标签: jquery

my website上,当我加入jquery.easing.1.3.js时,我收到以下错误:

'jQuery' is undefined. jquery.easing.1.3.js
code 0
URI: http://notable.ca/stoli/js/jquery.easing.1.3.js
line 39
char 1

有谁知道这意味着什么?

以下是我如何包含脚本:

<script type="text/javascript" src="http://notable.ca/stoli/js/onload_basic.js"></script>
<script type="text/javascript" src="http://notable.ca/stoli/js/widths.js"></script>
<script type="text/javascript" src="http://notable.ca/stoli/js/jquery.easing.1.3.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="http://notable.ca/stoli/js/validation.js"></script>

4 个答案:

答案 0 :(得分:3)

你需要在你的html BEFORE这个插件中包含jQuery库。

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="http://notable.ca/stoli/js/onload_basic.js"></script>
<script type="text/javascript" src="http://notable.ca/stoli/js/widths.js"></script>
<script type="text/javascript" src="http://notable.ca/stoli/js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="http://notable.ca/stoli/js/validation.js"></script>

答案 1 :(得分:1)

你的JS加载顺序错误。

Jquery应该是要加载的 FIRST

答案 2 :(得分:0)

您在之后包含了jQuery ,其中包含了缓动脚本:

<script type="text/javascript" src="http://notable.ca/stoli/js/jquery.easing.1.3.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>

缓动取决于jQuery,因此您需要先包含它。

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="http://notable.ca/stoli/js/jquery.easing.1.3.js"></script>

答案 3 :(得分:0)

你在加载jQuery之前包含了这个插件。将jQuery加载移动到JavaScript包含的顶部。