$是jQuery中的未定义错误 [英] $ is undefined error in jquery

查看:274
本文介绍了$是jQuery中的未定义错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Twitter引导程序时出现此错误.在html中使用它时,我没有收到此错误.我将其转换为wordpress主题,现在却遇到此错误.

I am getting this error while using twitter bootstrap. I didn't get this error when using it in html. I converted it into a wordpress theme, and now i am getting this error.

<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$('.dropdown-toggle').dropdown()
</script>

我遇到这些错误.

    bootstrap-dropdown.js第72行上的
  1. "$未定义".
  2. "$(".dropdown-toggle).dropdown不是函数"
  1. "$ is undefined" on bootstrap-dropdown.js line 72.
  2. "$(".dropdown-toggle").dropdown is not a function"

非常感谢您的帮助. 谢谢.

any help is much appreciated. thanks.

我尝试了 https://stackoverflow.com/a/9301017/759257

并包含最新的jquery版本1.7.1,现在可以使用了!!

and included the latest jquery version 1.7.1 and now it works!!

推荐答案

您以错误的顺序加载了脚本.首先加载jQuery,否则它将无法用于引导脚本.

You're loading the scripts in the wrong order. Load jQuery first, otherwise it won't be available for the bootstrap script.

这篇关于$是jQuery中的未定义错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆