jquery绑定事件

<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var aa=function (flg){
 $("p").slideToggle();
alert(flg);
}
  $("button").bind("click",0,aa); //达到效果,每次点击后才执行aa函数
$("button1").bind("click",0,aa(0));//跟预想不一样,刚开始加载页面时就执行了aa函数,只执行这次,点击的时候就不会执行了
 
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<button>请点击这里</button>
<button1>请点击这里1</button>
</body>
</html>
aa,函数“变量”
aa(0),执行函数的结果
原文地址:https://www.cnblogs.com/blackheartinsunshine/p/5112624.html