总有人间一两风,填我十万八千梦

jQuery .callbacksfireWith() 用法 手册 | 示例代码

jQuery开发手册 归档 106℃ 0评论

描述: 访问给定的上下文和参数列表中的所有回调。

  • 添加的版本: 1.7callbacks.fireWith( [context ] [, args ] )

    • context
      Type:
      该列表中的回调被触发的上下文引用
    • args
      Type:
      一个参数或参数列表传回给回调列表。

此方法返回绑定它的那个回调对象(this).

Example

使用 callbacks.fireWith() 访问给定的上下文和参数列表中的所有回调:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// a sample logging function to be added to a callbacks list
var log = function( value1, value2 ) {
console.log( "Received: " + value1 + "," + value2 );
};
var callbacks = $.Callbacks();
// add the log method to the callbacks list
callbacks.add( log );
// fire the callbacks on the list using the context "window"
// and an arguments array
callbacks.fireWith( window, ["foo","bar"]);
// outputs: "Received: foo, bar"

转载请注明:悠然品鉴 » jQuery .callbacksfireWith() 用法 手册 | 示例代码

喜欢 (0)or分享 (0)
发表我的评论
取消评论

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
Open Popup

致:那些天天发邮件购买网站的RZ们

  • 我只是博客不更新了,不代表我域名上没有其他服务在运行,PS:服务器2027年到期。
    况且,你们自己心里很清楚你们买域名是干嘛的!不要在垃圾邮件OK?
    随便测试一下你们的 mail/domain 信息,笑死~~ 但凡有一个正经的,我都会回复一下。