jQuery 1.4.2 VSDoc

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

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

这是工具包的新的MS CDN (replace旧的microsoft.com域)。

冒险可以从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的网页和当前的“live”和“die”的定义中分离出来,但是可以随意调整。

另外,在第224行:

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

你总是从http://docs.jquery.com/Downloading_jQuery得到它; – 如果它还没有,它还没有可用。 v1.4.1存在 – 见截图 – 但1.4.2还没有准备好。

替代文字160wpb4.png

只是注意Herb的答案。 无论如何,2940线正处于“触发”方法的中间。 我在2949年之后插入了代码。另外,由于我花了大约45分钟才弄明白为什么这些评论不适用于这两个新例程 – “汇总”标签中有太多的标签!

这是正确的版本:

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

不知道是否是“正式版本”,但现在可以从Microsoft CDN下载1.4.2-vsdoc文件: http ://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2-vsdoc.js

我决定创build一个基于这个问题和答案的input,并分享它。 你可以从这个博客文章下载:

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

希望有所帮助!

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

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

注意:我不得不修改脚本源path,然后再次将其更改回强制vs来拾取vsdoc。 我刚刚在src属性值的开始处添加了正斜杠,然后将其删除。

约翰T说:

为了什么是值得的,从这个问题:

jQuery 1.4.3 vsdoc

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

http://appendto.com/community/vsdoc

@John T:感谢您的链接!

对于这里提供的v1.4.4 VSDOC文件的用户来说,有一个小的错误会打断IntelliSense; 在1751行的文件是这样写的:

jQuery.proxy = function(function, context){

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

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

更新这一行阅读:

jQuery.proxy = function(method, context){

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

为了什么是值得的,从这个问题:

jQuery 1.4.3 vsdoc

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

http://appendto.com/community/vsdoc

使用VS2008 SP1和JSDoc修补程序,我仍然得到这个错误与jQuery 1.4.4:

警告1更新JScript IntelliSense时出错:\ Website \ Javascript \ jQuery \ jquery-1.4.4-vsdoc.js:'class2type'未定义@ 2401:8

使用jQuery 1.4.4以及来自http://appendto.com/community/vsdoc的vsdoc(以及〜1750行的修复),我可以无误地更新我的Intellisense; 不过,每当我input:

$。

我不但没有得到任何相关的Intelliprompts,但我看到:

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

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

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

  //My Function }; 

})(jQuery的);

我有一个警告:“预期的expression式”在第一个closuresparen在})(jQuery); 但是我在代码中找不到语法错误。 即使整个function被注释掉了,Intellisense也没有输出。

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

另外,NuGet中的jQuery包含有使用这个工具生成的vsdoc文件。

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

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

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

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

只要searchvsdoc,你会发现它:)

现在它不在官方的jQuery下载页面

你可以从这里得到它:

ajax/jQuery/jquery-1.4.2-vsdoc.js

这是由微软主办的一个网站。

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

ajax/jQuery/jquery-2.1.0-vsdoc.js

并立即开始下载。

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

http://docs.jquery.com/Downloading_jQuery

新墨西哥州看着错误的地方