Her*_*erb 27
冒险者可以从2949开始添加以下行:
delegate: function( selector, types, data, fn ) {
/// <summary>
/// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. See also "live".
/// </summary>
/// <param name="selector" type="String">
/// An expression to search with.
/// </param>
/// <param name="types" type="String">
/// A string containing a JavaScript event type, such as "click" or "keydown".
/// </param>
/// <param name="data" type="Object">
/// A map of data that will be passed to the event handler.
/// </param>
/// <param name="fn" type="Function">
/// A function to execute at the time the event is triggered.
/// </param>
return this.live( types, data, fn, selector );
},
undelegate: function( selector, types, fn ) {
/// <summary>
/// Remove a handler from the event for all elements which match the current selector, now or in the future, based upon a specific set of root elements. See also "die".
/// </summary>
/// <param name="selector" type="String">
/// An expression to search with.
/// </param>
/// <param name="types" type="String">
/// A string containing a JavaScript event type, such as "click" or "keydown".
/// </param>
/// <param name="data" type="Object">
/// A map of data that will be passed to the event handler.
/// </param>
/// <param name="fn" type="Function">
/// A function to execute at the time the event is triggered.
/// </param>
if ( arguments.length === 0 ) {
return this.unbind( "live" );
} else {
return this.die( types, null, fn, selector );
}
},
Run Code Online (Sandbox Code Playgroud)
该文档几乎从jQuery网页和"live"和"die"的当前定义中删除,但可以根据需要随意调整.
另外,在第224行:
// The current version of jQuery being used
jquery: "1.4.2",
Run Code Online (Sandbox Code Playgroud)
mar*_*c_s 23
你总是从http://docs.jquery.com/Downloading_jQuery得到它- 如果它还没有,它还没有.v1.4.1存在 - 见截图 - 但1.4.2还没有准备好.
替代文字http://i45.tinypic.com/29wwdnq.png
Joh*_*n T 12
只是关于赫伯答案的说明.无论如何,对于我来说,2940行是在"触发"方法的中间.我在2949之后插入了代码.此外,由于我花了大约45分钟来弄清楚为什么评论不适用于这两个新例程 - "摘要"标签中有一个太多'm'!
这是更正后的版本:
delegate: function(selector, types, data, fn) {
/// <summary>
/// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. See also "live".
/// </summary>
/// <param name="types" type="String">
/// A string containing a JavaScript event type, such as "click" or "keydown".
/// </param>
/// <param name="data" type="Object">
/// A map of data that will be passed to the event handler.
/// </param>
/// <param name="fn" type="Function">
/// A function to execute at the time the event is triggered.
/// </param>
/// <param name="selector" type="String">
/// An expression to search with.
/// </param>
return this.live(types, data, fn, selector);
},
undelegate: function(selector, types, fn) {
/// <summary>
/// Remove a handler from the event for all elements which match the current selector, now or in the future, based upon a specific set of root elements. See also "die".
/// </summary>
/// <param name="selector" type="String">
/// An expression to search with.
/// </param>
/// <param name="types" type="String">
/// A string containing a JavaScript event type, such as "click" or "keydown".
/// </param>
/// <param name="fn" type="Function">
/// A function to execute at the time the event is triggered.
/// </param>
if (arguments.length === 0) {
return this.unbind("live");
} else {
return this.die(types, null, fn, selector);
}
},
Run Code Online (Sandbox Code Playgroud)
小智 8
最新的VSDoc支持版本似乎是微软的v.1.4.4,可以在http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js找到.
它是工具包的新MS CDN(取代旧的microsoft.com域).
小智 6
除了重命名VSDoc文件(1.4.1)之外,您还可能需要将1.4.1-vsdoc.js文件中使用的jQuery版本号更改为1.4.2.
见第224行,
// The current version of jQuery being used
jquery: "1.4.2",
Run Code Online (Sandbox Code Playgroud)
小智 6
我决定根据这个问题和答案的输入创建一个并分享它.您可以从以下博客文章下载它:
http://hugeonion.com/2010/06/26/here-is-the-missing-jquery-1-4-2-vsdoc-file/
希望有所帮助!
| 归档时间: |
|
| 查看次数: |
21801 次 |
| 最近记录: |