日期:2014-05-16  浏览次数:20697 次

第一个jquery程序不运行
本帖最后由 showbo 于 2012-09-28 17:38:35 编辑
<!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>
    <title></title>
</head>
<body>
<img id="img1" src="baidu_sylogo1.gif" alt="baidu"/>


<script>
    $(document).ready(function () {
        $("img").fadeOut(6000);
    });
    
</script>

<script src="Scripts/jquery-1.4.1.js"> </script>
</body>
</html>


------解决方案--------------------
<!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>
  <title></title>
</head>
<body>
<img id="img1" src="http://avatar.profile.csdn.net/F/E/B/2_lude8880.jpg" alt="baidu"/>


<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
  $(document).ready(function () {
  $("img").fadeOut(3000);
  });
    
</script>

</body>
</html>




确认你的jq路径
------解决方案--------------------
检查你jquery类库的路径,jquery要是发生了异常你很难搞,一堆压缩过的文件

使用firefox+firebug