解决方案 »

  1.   

     $("testbutton")
     $("#testbutton")上面还小了个<script>
      

  2.   

    建议你安装firefox,并在上面安装firebug插件。有js错误一下子就能发现的……
      

  3.   

    firefox装了地,firebug也有,不过不太会用(刚学)二楼说的#加了,没起作用,<script type="text/JavaScript" src="jquery.js"> </script>也加了,还是没什么反应
      

  4.   

    这样改了一下,也不行。<script type="text/JavaScript" src="jquery.js">
    <script>
    $(document).ready(function(){
    //
    $("#testbutton").click(
    function(){
    $("#second").append("<b>Just a test.</b>");
    }
    );
    });
    </script>
      

  5.   

    导入的js文件和js代码块不要公用一个script标签,要分开        <script type="text/JavaScript" src="jquery.js"></script>
            <script type="text/JavaScript">

                $(document).ready(function () {
                    //
                    $("#testbutton").click(
                function () {
                    $("#second").append("<b>Just a test.</b>");
                }
                );
                });
            </script>
      

  6.   

    还是不行,我把引入的script那句 注销掉了也不行
    包含引入js的如下:
    这样在firebug中会提示ReferenceError: $ is not defined,我怀疑是不是中文输入时的全角问题,不过我用英文输入法重写了一次,还是这样。<script type="text/javascript" src="jquery.js"></script>
    <script type="text/JavaScript" >
    $(document).ready(function(){
    //
    $("#testbutton").click(
    function(){
    $("#second").append("<b>Just a test.</b>");
    }
    );
    });
    </script>去掉引入的如下: <script type="text/JavaScript" >
    $(document).ready(function(){
    //
    $("#testbutton").click(
    function(){
    $("#second").append("<b>Just a test.</b>");
    }
    );
    });
    </script>
      

  7.   

    ReferenceError: $ is not defined肯定你jquery路径错了。。
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
            <title>jQuery Playground</title>
            <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
            <script type="text/JavaScript"> 
                $(document).ready(function () {
                    //
                    $("#testbutton").click(
                function () {
                    $("#second").append("<b>Just a test.</b>");
                }
                );
                });
            </script>
     
            <style type="text/css">
                #second{
                    color: white;
                    background-color: green;
                    }
                .indianred{
                    background-color: #CD5C5C;   
                    }
            </style>
        </head>
        <body>
            <div id="wrapper">
                <h1>jQuery Playground</h1>
                <ul id= "nav">
                    <li><a class="current" href="index.html">测试页面</a></li>
                    <li><a href="#">关于</a></li>
                </ul>
            </div>
            <div id="content">
                <button id="testbutton">test</button>
                <br/><br/>
                    <div id="first">
                        this a word for test, before run location is home of test text.
                    </div>
                    <div id="second">
                        UT bibendum nulla eget ligula. Pellenttesque rhoncus pellentesque ipsum.
                    </div>
                    <div id="third">
                        this is a word for test, before run location is end of test text.
                    </div>
            </div>
            <div id="foot">Powered By Jerry.</div>
        </body>