这篇文章主要介绍了jquery的bind方法参数传递与接收的三种方法,需要的朋友可以参考下
方法一、
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"));
以上就是简述Jquery中Bind函数的三种传递介绍参数的方法的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号