jQuery.proxy向函数中传参的小例子
发布时间:2015-11-20 编辑:jiaochengji.com
本文介绍下,使用jQuery.proxy向函数中传参的例子,有需要的朋友参考下。
学习下jquery.proxy的用法,可以向函数中传递参数。
例子:
复制代码 代码示例:
//jQuery.proxy函数传参
for (j = td_counter; j < rows; j++) {
td = document.createElement("td");
td.innerHTML = ' ';
td.onclick = $.proxy(this.onclick, this, i);
tr.appendChild(td);
}
for (j = td_counter; j < rows; j++) {
td = document.createElement("td");
td.innerHTML = ' ';
td.onclick = $.proxy(this.onclick, this, i);
tr.appendChild(td);
}
您可能感兴趣的文章:
jQuery.proxy向函数中传参的小例子
JavaScript MVC 学习笔记(三)类的使用(中)
jquery.proxy的四种使用场景及疑问
js参数可变函数与动态函数
小白必看的Python基础之函数篇
javascript函数arguments参数的小例子
【PHP学习】新手必备PHP常用函数大集合
C语言中变量定义/声明深入分析
如何进行python函数参数的传递?
php大小写转换函数(strtolower、strtoupper)用法简介
[关闭]