Javascript Firebug错误

Javascript Firebug错误,javascript,jquery,firebug,Javascript,Jquery,Firebug,我有一个JavaScript代码优惠券.js定义如下- jQuery(document).ready(function(){ jQuery('.appnitro').submit( function() { $.ajax({ url : $(this).attr('action'), type : $(this).attr('method'), dataType: 'json', data : $(this).serialize(), success : function( data

我有一个JavaScript代码优惠券.js定义如下-

jQuery(document).ready(function(){
jQuery('.appnitro').submit( function() {
$.ajax({
 url : $(this).attr('action'),
 type : $(this).attr('method'),
 dataType: 'json',
 data : $(this).serialize(),
 success : function( data ) {
 for(var id in data) {
 jQuery('#' + id).html( data[id] );
 }
 }
 });
现在Firebug抛出以下错误-

jQuery is not defined
[Break on this error] jQuery(document).ready(function(){\n

有人能解释一下错误和消除错误的方法吗?提前感谢。

您的页面似乎没有包含jquery

<script type="text/javascript"
   src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>

在任何其他脚本之前,将其放入页面的
标题部分:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

如何引用JQuery JS脚本文件?或者它们指向不存在的位置,或者它们不存在,或者您使用了一个自动关闭脚本标记()

它不需要位于。许多JS大师都主张将这些放在正文的末尾,以加速页面加载。