日期:2014-05-17  浏览次数:20699 次

jquery 怎么引用?
引用<script type="text/javascript" src="WEB-INF/js/jquery-1.3.2.js"></script>后
<script type="text/javascript">
  $(document).ready(function(){
  //代码
  alert("aaabbb");
  });
</script>
用ie8访问时,说“$(document).ready()……”缺少对象,无法弹出消息框,是怎么回事啊?
请各位帮忙解决下,谢谢

------解决方案--------------------
应该是js路径错误,如果当前页面在web-info下,直接用src="js/jquey-1.3.2.js"就ok,也可以从根目录一层一层写,如src="/web-info/js/jquey-1.3.2.js",
------解决方案--------------------
看看路径对不对。要不换火狐试试,也许是浏览器不兼容。
------解决方案--------------------
这也能出错,见鬼了。
HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js测试</title>
<style type="text/css">


</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script>
    $(document).ready(function()
    {
        //代码
        alert("aaabbb");
    });

</script>
<script>
    
</script>
</head>
<body>

<ul>



</body>
</html>

------解决方案--------------------
围观中。。。。。。。。。。。。。。。。。。。
------解决方案--------------------
直接

HTML code

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script language="javascript">
google.load("jquery", "1.3.1");
</script>
<script language="javascript">
    $(document).ready()
</script>