您的位置:首页 > Web前端 > JQuery

jQuery on方法传递参数示例

2014-12-09 00:00 411 查看
教你如何给 jQuery on方法绑定的函数传递参数,代码如下:

$(".loadingFlower").on("click",'',{name:"123",id:"234",tel:"345"},callback)

 

function callback(event){

   console.log(event.data.name);    //参数1 =>123

   console.log(event.data.id);      //参数2 =>234

   console.log(event.data.tel);     //参数3 =>345

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: