chi7na 2009-11-30 22:34
浏览 250
已采纳

同样的代码在我的计算机上不能运行

因为项目要求在学jQuery,做了个helloWorld的例子,在同事的机器上没有任何问题,在我的机器上就是不行。代码如下
custom.js:
$(document).ready.(function(){
$("#first").click(function(){
alert("Hello world !");
});
});
starterkit.html :




jQuery Starterkit


jQuery Starterkit

This page contains code to test the examples. Most of it is only relevant for a example.

Some link

Go to top



[b]问题补充:[/b]
昨天着急问题写的不够详细,我用的xp3的系统浏览器是ie7后来下了个ff3.5也试了,还是不行。二楼的仁兄,你说的方法我已经试过了

  • 写回答

2条回答 默认 最新

  • wanghaolovezlq 2009-12-01 09:39
    关注

    晕,你代码写错了
    多了一个“.”

      $(document).ready[color=red].[/color](function(){ 
     $("#first").click(function(){ 
     alert("Hello world !"); 
    

    });
    });

    修改下就行了

      $(document).ready(function(){ 
     $("#first").click(function(){ 
     alert("Hello world !"); 
    

    });
    });

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?