我已经准备了一些类似的问题,并已验证 jquery 是第一个包含的脚本...
// this test confirms that jquery is defined
if (typeof jQuery == 'undefined') {
alert('jquery not defined');
}
// (this is being alerted)
else { alert( 'jquery is defined'); }
// this is what I want to achieve (to begin with)
jquery("#free-signup").css( 'display', 'none' );
jquery 似乎确实被定义了......我做错了什么?!
最佳答案
JavaScript 区分大小写。您应该使用正确的对象名称:
// v
jQuery("#free-signup").css( 'display', 'none' );
或快捷方式:
$("#free-signup").css( 'display', 'none' );
关于jquery - "Uncaught ReferenceError: jquery is not defined"- 但它是,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13473325/