Home  >  Article  >  Web Front-end  >  jQuery on方法传递参数示例_jquery

jQuery on方法传递参数示例_jquery

WBOY
WBOYOriginal
2016-05-16 16:28:011453browse

教你如何给 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
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn