Microsoft JScript运行时错误:"$"未定义 [英] Microsoft JScript runtime error: '$' is undefined

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

问题描述

我正在尝试使用以下代码在视图中隐藏/显示元素:

I am trying to hide/show elements in a view using following code:

$('buttonClass/IDhere').click(function (){
$('theDivYouWantToShowClass/IDhere').toggle();
});

但是,我不断获得

Microsoft JScript runtime error: '$' is undefined

可能是问题所在,怎么解决?

What might be the issue and how do I fix it?

推荐答案

$默认是在加载jquery时定义的.我会尝试使用jquery()来查看是否以某种方式卸载了$等.您还可以加载firebug并点击页面.它应该显示为全局变量/函数.注意:您也可以将jquery设置为不设置简写"$".

$ is defined by default when you load jquery. I would try and use jquery() to see if somehow $ is being unloaded etc. You can also load up firebug and hit the page. It should show up as a global variable/function. NOTE: You can also setup jquery to not setup the short hand "$".

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

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