jQuery 1.4.2 VSDoc

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2323366/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 13:14:50  来源:igfitidea点击:

jQuery 1.4.2 VSDoc

jqueryvisual-studiovsdoc

提问by benpage

Where can I get the VSDoc for jQuery 1.4.2?

我在哪里可以获得 jQuery 1.4.2 的 VSDoc?

采纳答案by Art

The latest VSDoc supported version seems to be v.1.4.4 from Microsoft and can be found at http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js.

最新的 VSDoc 支持版本似乎是来自 Microsoft 的 v.1.4.4,可以在http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js找到。

It is the new MS CDNfor toolkits (replacing the old microsoft.com domain).

它是用于工具包的新 MS CDN(替换旧的 microsoft.com 域)。

回答by Herb

The adventurous can add the following lines starting at 2949:

喜欢冒险的可以从 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 );
    }
},

That documentation is pretty much ripped from jQuery web pages and from current definitions of "live" and "die", but feel free to adjust as you see fit.

该文档几乎是从 jQuery 网页以及“活”和“死”的当前定义中撕下来的,但您可以根据需要随意调整。

Also, at line 224:

另外,在第 224 行:

// The current version of jQuery being used
    jquery: "1.4.2",

回答by marc_s

You always get it from http://docs.jquery.com/Downloading_jQuery- if it's not there yet, it's not available yet. v1.4.1 exists - see screenshot - but 1.4.2 isn't ready yet.

您总是可以从http://docs.jquery.com/Downloading_jQuery获取它- 如果它还没有,则它尚不可用。v1.4.1 存在 - 见截图 - 但 1.4.2 还没有准备好。

alt text

替代文字

回答by John T

Just a note on Herb's answer. Line 2940, for me anyway, was in the middle of the 'trigger' method. I inserted the code after 2949. Also, since it took me about 45 minutes to figure out why the comments weren't working for those two new routines - the "summary" tags have one too many 'm's in them!

只是关于赫伯回答的注释。无论如何,对我来说,第 2940 行处于“触发”方法的中间。我在 2949 之后插入了代码。另外,因为我花了大约 45 分钟才弄清楚为什么这些注释对这两个新例程不起作用 - “摘要”标签中有太多的“m”!

Here's the corrected version:

这是更正后的版本:

        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);
        }
    },

回答by blueling

Not sure if it is the "official version" but now a 1.4.2-vsdoc file can be downloaded from the Microsoft CDN: http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2-vsdoc.js

不确定它是否是“官方版本”,但现在可以从 Microsoft CDN 下载 1.4.2-vsdoc 文件:http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2-vsdoc.js

回答by mahmud khaled

As well as renaming the VSDoc file (1.4.1) you may also have to change the jQuery version number used in the 1.4.1-vsdoc.js file to 1.4.2.

除了重命名 VSDoc 文件 (1.4.1) 之外,您可能还必须将 1.4.1-vsdoc.js 文件中使用的 jQuery 版本号更改为 1.4.2。

See line# 224,

见第 224 行,

// The current version of jQuery being used
    jquery: "1.4.2",

回答by Christopher Hujanen

I decided to create one based on the input from this question & answers and share it. You can download it from this blog post:

我决定根据这个问题和答案的输入创建一个并分享它。你可以从这个博客文章下载它:

http://hugeonion.com/2010/06/26/here-is-the-missing-jquery-1-4-2-vsdoc-file/

http://hugeonion.com/2010/06/26/here-is-the-missing-jquery-1-4-2-vsdoc-file/

Hope that helps!

希望有帮助!

回答by Mr Grok

For the time being you could always just rename "jquery-1.4.1-vsdoc.js" to "jquery-1.4.2-vsdoc.js" and when they release the new vsdoc version just replace it.

目前,您始终可以将“jquery-1.4.1-vsdoc.js”重命名为“jquery-1.4.2-vsdoc.js”,当他们发布新的 vsdoc 版本时,只需将其替换即可。

Note: I had to then modify the script source path and then change it back again to force vs to pick up the vsdoc. I just added a forward slash at the start of the src attribute value and then removed it.

注意:然后我必须修改脚本源路径,然后再次将其更改回来以强制 vs 获取 vsdoc。我只是在 src 属性值的开头添加了一个正斜杠,然后将其删除。

回答by robyaw

John T said:

约翰 T 说:

For what it's worth, and from this question:

jQuery 1.4.3 vsdoc

Someone has updated the jQuery vsdoc for JQuery 1.4.3. It's at:

http://appendto.com/community/vsdoc

对于它的价值,以及从这个问题:

jQuery 1.4.3 vsdoc

有人更新了 JQuery 1.4.3 的 jQuery vsdoc。它在:

http://appendto.com/community/vsdoc

@John T: Thanks for the links!

@John T:感谢您的链接!

For users of the v1.4.4 VSDOC file supplied here, there is a slight error that breaks IntelliSense; at line 1751 the file reads:

对于这里提供的 v1.4.4 VSDOC 文件的用户,有一个轻微的错误会破坏 IntelliSense;在第 1751 行,文件内容如下:

jQuery.proxy = function(function, context){

jQuery.proxy = function(function, context){

This causes Visual Studio to show the following error:

这会导致 Visual Studio 显示以下错误:

Error updating JScript IntelliSense: <your path>\jquery-1.4.4-vsdoc.js: Expected identifier @ 1750:24(or near enough).

Error updating JScript IntelliSense: <your path>\jquery-1.4.4-vsdoc.js: Expected identifier @ 1750:24(或足够接近)。

Update this line to read:

更新此行以阅读:

jQuery.proxy = function(method, context){

jQuery.proxy = function(method, context){

This bug was found and resolved in VS2008.

这个错误是在 VS2008 中发现并解决的。

回答by robyaw

Using jQuery 1.4.4, and the vsdoc from http://appendto.com/community/vsdoc(as well as the fix for line ~1750), I can update my Intellisense without error; however, whenever I type:

使用 jQuery 1.4.4 和来自http://appendto.com/community/vsdoc的 vsdoc (以及第 ~1750 行的修复程序),我可以毫无错误地更新我的 Intellisense;但是,每当我输入:

$.

$.

Not only do I not get any relevant Intelliprompts, but I see:

我不仅没有得到任何相关的智能提示,而且我看到:

Javascript Intellisense Message: JSIntellisense:Internal/(3:4) : Object required

Javascript Intellisense 消息:JSIntellisense:Internal/(3:4):需要对象

This references the first function in my .js file:

这引用了我的 .js 文件中的第一个函数:

; (function ($) { $.fn.MobileFunction = function (options) {

; (功能($){ $.fn.MobileFunction = 功能(选项){

   //My Function
};

})(jQuery);

})(jQuery);

I do have one warning: "Expected Expression" on the first closing paren in })(jQuery); but I cannot find a syntax error in the code. Even with the entire function commented out, Intellisense produces no output.

我确实有一个警告:在 })(jQuery) 中第一个右括号上的“预期表达式”;但我在代码中找不到语法错误。即使注释掉整个函数,Intellisense 也不会产生任何输出。