【问题标题】:jQuery 1.4.2 VSDocjQuery 1.4.2 VSDoc
【发布时间】:2010-02-24 02:57:53
【问题描述】:

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

【问题讨论】:

    标签: jquery visual-studio vsdoc


    【解决方案1】:

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

    该文档几乎是从 jQuery 网页以及当前对“生”和“死”的定义中提取的,但您可以随意调整。

    另外,在第 224 行:

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

    【讨论】:

    • 如果真的这么简单,那么为什么 仍然 jQuery.com 或 Microsoft 的 CDN (asp.net/ajaxlibrary/cdn.ashx) 上没有 Visual Studio 链接? (我意识到这更像是一种咆哮,但如果有人知道并可以分享,知道这将是有益的。)
    • 如果 jQuery 开发者很懒惰,他们可以发布新版本而不制作 Visual Studio 文档,因为社区只会为他们制作 :)
    • 我根据问题的所有答案创建了一个 1.4.2 版本 - 你可以从static.maximzaslavsky.com/jquery-1.4.2-vsdoc.js下载它
    • @James Skemp - MS 在他们一开始就对它感到兴奋之后,往往会失去对这种东西的兴趣。查看他们的框架参考源以获得类似的示例。显然,关键人员在组织内流动,没有其他人关心保持运转。
    • 进一步查看 John T 的答案 - 看起来现在正在处理这个问题
    【解决方案2】:

    您总是可以从http://docs.jquery.com/Downloading_jQuery 获得它 - 如果它还没有,那么它还不可用。 v1.4.1 已存在 - 请参见屏幕截图 - 但 1.4.2 尚未准备好。

    【讨论】:

    【解决方案3】:

    只是关于 Herb 的回答的注释。无论如何,对我来说,第 2940 行处于“触发”方法的中间。我在 2949 之后插入了代码。另外,由于我花了大约 45 分钟来弄清楚为什么 cmets 不能用于这两个新例程 - “摘要”标签中有一个太多的 '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);
            }
        },
    

    【讨论】:

    • 对我来说也是第 2949 行。
    • 谢谢约翰。到2940看到那条线在扳机中间的时候有点担心。
    【解决方案4】:

    不确定是不是“正式版”,但现在可以从微软CDN下载一个1.4.2-vsdoc文件:http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2-vsdoc.js

    【讨论】:

    • 我认为这个文件可能有错误。如果我使用 $(document).ready,我会在第 486 行收到错误:readyBound 未定义。
    • 是的,我将它与我使用上述编辑创建的 jquery-1.4.2.min-vsdoc.js 进行了比较,它非常不同 - 缺少很多例程。
    • @Josh:同意。这个文件是 fubar - 在 jquery 例程中出现许多脚本错误,readyBound/quickExpr/class2type 未定义等...这是 jquery 还是 MS 问题?
    【解决方案5】:

    最新的VSDoc支持版本好像是微软的v.1.4.4,可以找到 在http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js

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

    【讨论】:

      【解决方案6】:

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

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

      希望有帮助!

      【讨论】:

        【解决方案7】:

        除了重命名 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",
        

        【讨论】:

          【解决方案8】:

          暂时您可以随时将“jquery-1.4.1-vsdoc.js”重命名为“jquery-1.4.2-vsdoc.js”,当他们发布新的 vsdoc 版本时,只需替换它。

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

          【讨论】:

            【解决方案9】:

            约翰 T 说:

            为了它的价值,从这个 问题:

            jQuery 1.4.3 vsdoc

            有人更新了 jQuery vsdoc 对于 jQuery 1.4.3。它位于:

            http://appendto.com/community/vsdoc

            @John T:感谢您的链接!

            对于此处提供的 v1.4.4 VSDOC 文件的用户,有一个小错误会破坏 IntelliSense;在第 1751 行,文件读取:

            jQuery.proxy = function(function, context){

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

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

            将此行更新为:

            jQuery.proxy = function(method, context){

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

            【讨论】:

              【解决方案10】:

              为了它的价值,从这个问题:

              jQuery 1.4.3 vsdoc

              有人为 JQuery 1.4.3 更新了 jQuery vsdoc。它位于:

              http://appendto.com/community/vsdoc

              【讨论】:

              • 看起来 MS 可能会付钱给 appendTo 来接受这个。当然,jQ 1.4.4也是当天发布的……
              【解决方案11】:

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

              $。

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

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

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

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

                 //My Function
              };
              

              })(jQuery);

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

              【讨论】:

                【解决方案12】:

                FWIW,您可以使用托管在http://damianedwards.com/vsdoc 的在线工具为 jQuery 版本 1.4.2 及更高版本生成

                此外,NuGet 中的 jQuery 包包含使用此工具生成的 vsdoc 文件。

                这个工具实际上是从 api.jquery.com 抓取官方 API 文档并将其与(浏览器)内存中的实际 jQuery 对象合并,而不是尝试进行源合并。它不是 100% 完美,但非常接近(比旧方法更接近)。

                另外,从这里的一些答案和 cmets 来看,有些人实际上是从他们的网页中引用 vsdoc 文件。不要这样做。 vsdoc 文件是专门为服务 Visual Studio IntelliSense 而构建的,无法在浏览器中正常工作。只需引用实际的 jQuery 文件(或 .min 版本),Visual Studio 就会自动找到它旁边的 .vsdoc 文件版本(包括如果您从 CDN 引用它)。

                【讨论】:

                  【解决方案13】:

                  此页面包含微软 CDN 上的 vsdoc 文件列表

                  http://www.asp.net/ajaxlibrary/cdn.ashx

                  只要搜索 vsdoc 你就会找到它:)

                  现在它不在官方 jquery 下载页面上

                  【讨论】:

                    【解决方案14】:

                    你可以从这里得到它:

                    http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.2-vsdoc.js

                    这是一个由 Microsoft 托管的网站。

                    注意如果你需要一个更新的版本,比如说jQuery 2.1.0,只要改变上面路径中的版本,即:

                    http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0-vsdoc.js

                    然后立即开始下载。

                    【讨论】:

                      【解决方案15】:

                      看起来他们已经将 1.4.2 添加到 JQuery 下载页面:

                      http://docs.jquery.com/Downloading_jQuery

                      NM 找错地方了

                      【讨论】:

                      • 该页面上没有指向 1.4.2 的 vsdoc 文件的链接,仅适用于 1.4.1
                      猜你喜欢
                      • 1970-01-01
                      • 2012-01-20
                      • 1970-01-01
                      • 1970-01-01
                      • 2014-07-21
                      • 1970-01-01
                      • 2011-06-20
                      • 2010-10-17
                      • 2011-03-06
                      相关资源
                      最近更新 更多