求助!!在线等,刚学习Jquery,按照书上打的,发现无法实现预期效果,试了下连简单的弹出提示窗口的Jquery代码都无法实现!!是什么原因,是jquery库没有加载成功还是浏览器问题(javascript代码运行正常,使用IE跟chrome浏览器都无法实现jquery语句)
<!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>无标题文档</title>
<script language="JavaScript" src="/js/jquery-1.7.2.js" type="text/javascript">
$('.mini').css("background-color","#C00");
</script>
<style type="text/css">
  div,span,p{
   width :140px;
    height:140px;
    margin:5px;
    background:#aaa;
    border:#000 1px solid;
    float:left;
    font-size:17px;
    font-family:Verdana;
    }
   div.mini{
   width:55px;
   height:55px;
   background-color: #aaa;
   font-size:12px;
   }
   div.hide{
   display:none;
   }
</style>
</head>

解决方案 »

  1.   

    $(document).ready( function() {
        $('.mini').css("background-color","#C00"); //这样呢?
    });
      

  2.   

    没有效果,凡是以$开头的jquery语句,都没有任何效果!不知道是什么原因,换了几个jquery版本的库了 还是无法实现!!!求大神指教!1
      

  3.   

    <script src="/js/jquery-1.7.2.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready( function() {
        $('.mini').css("background-color","#C00");
    });
    </script>晕,刚才居然没看出来。。
      

  4.   


    <!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>无标题文档</title>
    <script src="/js/jquery-1.7.2.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready( function() {
        $('.mini').css("background-color","#C00");
    });
    </script>
    <style type="text/css">
    代码修改了,但是还是没有任何效果!!哪怕编译简单的
    $(document).ready( function() {
        alert("hello world");});都没有效果! 疯了
    });
      

  5.   

    那肯定是没有没有正确加载jquery文件,用相对路径吧。如果在本地测试,用绝对路径肯定是无法正确加载的。
      

  6.   

    我用的就是相对路劲,我刚改成绝对路径了,结果成功了,看来还是没有正确加载的问题,感谢了!<script src="E:\Projects\Wedding\js\jquery-1.3.1.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready( function() {
        $('.mini').css("background-color","#C00");
    });
    </script>