类似这样:
function aa(vote){alert(vote);}
$(".btnn").bind("click",aa(1)});没有点击就开始执行了。怎么处理
解决:
$(".btnn").bind("click",function(){aa(1)})
或者:
var self=this;
$(".contmb .btnn").bind("click",aa.bind(self,1));
转载于:https://www.cnblogs.com/bomi/p/8866463.html
类似这样:
function aa(vote){alert(vote);}
$(".btnn").bind("click",aa(1)});没有点击就开始执行了。怎么处理
解决:
$(".btnn").bind("click",function(){aa(1)})
或者:
var self=this;
$(".contmb .btnn").bind("click",aa.bind(self,1));
转载于:https://www.cnblogs.com/bomi/p/8866463.html