Jquery之Bind方法参数传递与接收的三种方法_Javascript教程-查字典教程网
Jquery之Bind方法参数传递与接收的三种方法
Jquery之Bind方法参数传递与接收的三种方法
发布时间:2016-12-30 来源:查字典编辑
摘要:方法一、functionGetCode(event){alert(event.data.foo);}$(document).ready(fu...

方法一、

function GetCode(event) { alert(event.data.foo); }

$(document).ready(function() { $("#summary").bind("click", {foo:'abc'} ,GetCode); });

方法二、

函数句柄

$("#summary").bind("click", function() { GetCode("abc") });

function GetCode(str) { }

方法三、

函数闭包

function GetCode(str) { return function() { alert(str) }}

$("#summary").bind("click", GetCode("abc"));

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新Javascript教程学习
    热门Javascript教程学习
    编程开发子分类