简单的jQuery事件处理有关问题

简单的jQuery事件处理问题
<head>
  <title>学习jQuery事件</title>
  <script type ="text/javascript" src ="Scripts/jquery-1.4.1-vsdoc.js" />
  <script type ="text/javascript" >
  $("#std").bind("click", function (event) { alert("This is the first event."); });
  $("#std").bind("click", function (event) { alert("This is the second event."); });
   
  </script>
</head>
<body>
  <div >
  <input type ="button" id ="std" value ="study" style ="color : Blue ; width:8%; font-size:20px ;" />
  </div>
</body>
我刚刚学jquery,大家帮忙看看。我在点击按钮后发现并没有实现alert的提示效果

------解决方案--------------------
原因是页面顺序执行到js代码的时候还没有注册你所操作的html


<script type ="text/javascript" >
$("#std").bind("click", function (event) { alert("This is the first event."); });
$("#std").bind("click", function (event) { alert("This is the second event."); });

</script>
放在你的input控件的html下面

或者改成
<script type ="text/javascript" >
$(function(){
$("#std").bind("click", function (event) { alert("This is the first event."); });
$("#std").bind("click", function (event) { alert("This is the second event."); });
})
  

</script>
------解决方案--------------------
亲你是不是引用错误了jquery库了?Scripts/jquery-1.4.1-vsdoc.js这个是vs中对jquery智能感知的。
------解决方案--------------------
亲测可以使用。。。。
注意 $("#std").bind("click",。。。。需要放在 $(function () {.....}里面
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>
    <title>ajax事件顺序Demo</title>
    <script src="jquery-1.8.0.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#std")
            .bind("click", function (event) {
                alert("This is the first event.");
            });
            $("#std").unbind("click");//取消事件绑定,若不加这句,两个alert就会先后弹出来,不是“点击一次,弹框一次”的效果
            $("#std").bind("click", function () {
                alert("This is the second event.");
            });
        })
    </script>
</head>
<body>
    <div>
        <input type="button" id="std" value="study" style="color: Blue; width: 8%; font-size: 20px;" />
    </div>
</body>
</html>