Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery 1.4.2 VSDoc_Jquery_Visual Studio_Vsdoc - Fatal编程技术网

jQuery 1.4.2 VSDoc

jQuery 1.4.2 VSDoc,jquery,visual-studio,vsdoc,Jquery,Visual Studio,Vsdoc,我在哪里可以获得jQuery 1.4.2的VSDoc?您总是从哪里获得它-如果它还没有出现,那么它还不可用。v1.4.1已经存在-请参见屏幕截图-但是1.4.2还没有准备好 目前,您可以将“jquery-1.4.1-vsdoc.js”重命名为“jquery-1.4.2-vsdoc.js”,当他们发布新的vsdoc版本时,只需将其替换即可 注意:我必须修改脚本源路径,然后再次将其更改回强制vs拾取vsdoc。我只是在src属性值的开头添加了一个正斜杠,然后将其删除。除了重命名VSDoc文件(1.

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

您总是从哪里获得它-如果它还没有出现,那么它还不可用。v1.4.1已经存在-请参见屏幕截图-但是1.4.2还没有准备好


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


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

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

见第224行


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

只是赫伯回答的笔记。对于我来说,第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);
        }
    },
委托:函数(选择器、类型、数据、fn){
/// 
///根据一组特定的根元素,为现在或将来匹配选择器的所有元素的一个或多个事件附加处理程序。另请参见“活动”。
/// 
/// 
///包含JavaScript事件类型的字符串,如“单击”或“向下键”。
/// 
/// 
///将传递给事件处理程序的数据映射。
/// 
/// 
///触发事件时要执行的函数。
/// 
/// 
///用于搜索的表达式。
/// 
返回this.live(类型、数据、fn、选择器);
},
取消删除:函数(选择器、类型、fn){
/// 
///根据一组特定的根元素,现在或将来从事件中删除与当前选择器匹配的所有元素的处理程序。另请参阅“die”。
/// 
/// 
///用于搜索的表达式。
/// 
/// 
///包含JavaScript事件类型的字符串,如“单击”或“向下键”。
/// 
/// 
///触发事件时要执行的函数。
/// 
if(arguments.length==0){
返回此文件。解除绑定(“live”);
}否则{
返回此.die(类型、null、fn、选择器);
}
},

我决定根据此问答的输入创建一个并与大家分享。您可以从以下博客文章下载:


希望有帮助

不确定是否为“官方版本”,但现在可以从Microsoft CDN下载1.4.2-vsdoc文件:

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


NM在错误的地方寻找它的价值,从这个问题:

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

约翰·T说:


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

jQuery 1.4.3 vsdoc

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

@约翰T:谢谢你的链接

对于这里提供的v1.4.4vsdoc文件的用户,有一个小小的错误破坏了IntelliSense;在第1751行,文件读取:

jQuery.proxy=函数(函数,上下文){

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

更新JScript IntelliSense时出错:\jquery-1.4.4-vsdoc.js:预期标识符@1750:24(或足够接近)

将此行更新为:

jQuery.proxy=函数(方法、上下文){


此错误已在VS2008中找到并解决。

使用jQuery 1.4.4和中的vsdoc(以及第1750行的修复程序),我可以毫无错误地更新Intellisense;但是,每当我键入:

美元

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

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

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

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

})(jQuery)


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

支持VSDoc的最新版本似乎是Microsoft的v.1.4.4,可以找到 在


它是工具包的新MS(取代旧的microsoft.com域)。

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

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


现在它不在jquery的官方下载页面上,您可以使用托管在的在线工具为jquery 1.4.2及以上版本生成

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

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


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

您可以从以下位置获取:

这是一个由Microsoft托管的网站

注意如果您需要较新的版本,例如对于jquery2.1.0,只需更改版本即可
// The current version of jQuery being used
    jquery: "1.4.2",
        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);
        }
    },
   //My Function
};