jQuery callbacks.fireWith() 方法

jQuery 教程 · 2019-03-29 16:59:06

实例

访问给定的上下文"window"和数组参数调用列表中的所有回调

$(function () { //将被添加到列表的一个简单的函数 var log = function( value1, value2 ) { alert( "Received: " + value1 + "," + value2 ); }; var callbacks = $.Callbacks(); // 添加函数到列表 callbacks.add( log ); // 使用上下文"window"调用回调列表 // 和一个数组参数 callbacks.fireWith( window, ["foo","bar"]); // 输出: "Received: foo, bar" })

定义和用法

callbacks.fireWith() 函数给定上下文和参数来访问列表中的所有回调。

语法

callbacks.fireWith( [context ] [, args ] )

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

点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html

查看所有标签

Neural Networks for Applied Sciences and Engineering

Neural Networks for Applied Sciences and Engineering

Samarasinghe, Sandhya / CRC Pr I Llc / 2006-9 / $ 118.59

In response to the exponentially increasing need to analyze vast amounts of data, Neural Networks for Applied Sciences and Engineering: From Fundamentals to Complex Pattern Recognition provides scient......一起来看看 《Neural Networks for Applied Sciences and Engineering》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试