slice = Array.prototype.slice,
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
if ( typeof context === "string" ) {
var tmp = fn[ context ];
context = fn;
fn = tmp;
} // Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( !jQuery.isFunction( fn ) ) {
return undefined;
} // Simulated bind
var args = slice.call( arguments, 2 ),
proxy = function() {
return fn.apply( context, args.concat( slice.call( arguments ) ) );
}; // Set the guid of unique handler to the same of original handler, so it can be removed
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; return proxy;
},

jquery proxy的更多相关文章

  1. 个人对JQuery Proxy()函数的理解

    转载至:http://www.cnblogs.com/acles/archive/2012/11/20/2779282.html JQuery.proxy(function,context): 使用c ...

  2. jquery $.proxy使用

    在某些情况下,我们调用Javascript函数时候,this指针并不一定是我们所期望的那个.例如: //正常的this使用 $('#myElement').click(function() { // ...

  3. 【转】个人对JQuery Proxy()函数的理解

    原文地址:http://www.cnblogs.com/acles/archive/2012/11/20/2779282.html JQuery.proxy(function,context): 使用 ...

  4. jQuery.proxy()函数

    jQuery.proxy(),接受一个函数,然后返回一个新函数,并且这个新函数始终保持了特定的上下文(context)语境.   context 代表上下文 name是上下文的某个属性 jQuery. ...

  5. jQuery proxy详解

    第一次接触jQuery.proxy()时感觉这个方法不实用,不明白它到底是个什么意思.今天来将jQuery官网上的解释进行一下翻译,顺便添加自己的理解和一些示例.proxy也可称为代理. jQuery ...

  6. jquery.proxy的四种使用场景及疑问

    作者:zccst 其实只有两种使用方式,只不过每一种又细分是否传参. 先给一段HTML,后面会用来测试: <p><button id="test">Test ...

  7. jQuery.proxy() 函数详解

    jQuery.proxy()函数用于改变函数的上下文. 你可以将指定函数传入该函数,该函数将返回一个新的函数,其执行代码不变,但函数内部的上下文(this)已经被更改为指定值. 该函数属于全局的jQu ...

  8. jQuery.proxy()的用法

    一:参考范文一 第一次接触jQuery.proxy()时感觉这个方法不实用,不明白它到底是个什么意思.今天来将jQuery官网上的解释进行一下翻译,顺便添加自己的理解和一些示例.proxy也可称为代理 ...

  9. (转)jquery $.proxy的使用

    在某些情况下,我们调用Javascript函数时候,this指针并不一定是我们所期望的那个.例如: 1 //正常的this使用 2 $('#myElement').click(function() { ...

  10. jquery $.proxy使用 Jquery实现ready()的源码

    jquery $.proxy使用   在某些情况下,我们调用Javascript函数时候,this指针并不一定是我们所期望的那个.例如: 1 //正常的this使用 2 $('#myElement') ...

随机推荐

  1. 我的android学习脚步----------- Button 和监听器setonclicklistener

    最基本的学习,设置一个按钮并监听实现实时时刻显示 首先XML布局,在layout中的  activity_main.xml中拖一个Button按钮到相应位置 然后在xml文件中做修改 <Rela ...

  2. 转:web_submit_data函数

    web_submit_data函数处理无状态或者上下文无关的表单提交.它用来生成表单的GET或POST请求,这些请求与Form自动生成的请求是一样的.发送这些请求时不需要表单上下文. 函数语法:Int ...

  3. ecos的dbschema

    dbschema base/dbschema/apps.php <?php //apps表名 $db['apps'] = array( 'columns'=>array( 'app_id' ...

  4. 关于源码编译每次提示有错误 要make update-api

    最近编译newline的版本的时候..同事修改了andoid默认输入法为百度.这是系统自动提供的API,所以每次编译会提示 此时在编译源码生成SDK的过程中会出现这个问题:************** ...

  5. Delphi引用C对象文件(转)

    源:http://blog.csdn.net/henreash/article/details/7357618 C语言应用非常广泛,并在世界各地拥有大量的代码库.这些代码库与Delphi的可比性较小, ...

  6. Raspberry Pi 上使用WN725N连接WIFI

    系统版本 lee@Lee-RPi ~ $ uname -ar Linux Lee-RPi + # PREEMPT Thu Dec :: GMT armv6l GNU/Linux 这个版本的系统,已经集 ...

  7. sencha touch环境搭建

    引入touch文件,包括resources和sencha-touch-debug.js文件 index.html文件内容如下: <!DOCTYPE HTML> <html> & ...

  8. mongoose的virtual属性

    设置vitual属性 personSchema.virtual('name.full').get(function () { return this.name.first + ' ' + this.n ...

  9. Polipo

    polipo代理服务器简介 HTTP代理polipo的配置与使用:http://wuwei5460.blog.51cto.com/2893867/1407369/

  10. Spring第一个例子的补充

    1.首先导入需要的包: 2.文件结构: 3.先看xml配置文件: <?xml version="1.0" encoding="UTF-8"?> &l ...