40

Where can I get the VSDoc for jQuery 1.4.2?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
benpage
  • 4,418
  • 3
  • 41
  • 39

15 Answers15

27

The adventurous can add the following lines starting at 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.

Also, at line 224:

// The current version of jQuery being used
    jquery: "1.4.2",
Maxim Zaslavsky
  • 17,787
  • 30
  • 107
  • 173
Herb
  • 743
  • 5
  • 11
  • 4
    If it's this easy, seriously, why is there *still* not a Visual Studio link on jQuery.com, or Microsoft's CDN (http://www.asp.net/ajaxlibrary/cdn.ashx) ? (I realize this is more of a rant, but it would be beneficial to know, if someone knows and can share.) – James Skemp May 22 '10 at 22:01
  • 1
    If jQuery devs were lazy, they could release a new version and not make Visual Studio documentation, as the community would just make it for them :) – Maxim Zaslavsky Jul 05 '10 at 22:34
  • 15
    I created a 1.4.2 version based on all of the answers to the question - you can download it from http://static.maximzaslavsky.com/jquery-1.4.2-vsdoc.js – Maxim Zaslavsky Jul 05 '10 at 22:49
  • @James Skemp - MS just tends to lose interest in this sort of stuff after they get all excited about it at the outset. Look at their framework reference source for a similar example. Apparently the key personnel move within the organisation and no-one else cares to keep things running. – Will Dean Sep 13 '10 at 15:41
  • @Will Dean - I guess I'll wait until the next version (1.5) comes out. While unfortunate, I'd much rather belief that they haven't given up on jQuery just quite yet, and rather saw the 1.4.2 release as minor enough not to update the vsdoc. It's difficult to deny that jQuery isn't one of the more popular libraries, so I can't see it making business sense to drop it so suddenly. Since it's bundled with new MVC projects, perhaps we should ask Scott Gu/Ha ... – James Skemp Sep 14 '10 at 13:44
  • You may be right, but I'm more cynical, I'm afraid. My experience is that Scott Ha will be embarrassed on behalf of MS, but that won't be enough to get it fixed. Funny enough, in April 2009, I said "how many releases is JQuery intellisense annotation going to last for, do we all think?" in a comment on ScottHa's blog. The answer was of course '2 major releases'. You wait to see what (doesn't) happen to MVC if/when Haack moves on... – Will Dean Sep 14 '10 at 21:39
  • Thanks Maxim, even now (nov 2010) there is no official version of this file on jquery.com – Richard Nov 09 '10 at 08:19
  • 1
    See John T's answer further down - looks like this is being dealt with now – Will Dean Nov 12 '10 at 11:27
  • This is not a solution although its closer to delegate function $(document).ready(function(){ $("table").delegate("td","click",function(){ alert('I am' + $(this).text()); }); });
    Item 1 Item 2
    result with is `I amItem 1` result with vsdoc version: `I amItem 1 Item 2`
    – samarjit samanta Jan 30 '11 at 07:29
  • For anyone wondering where the VSDocs for 1.5 might be... wander over to Dave Ward's insanely great home of jQuery things, and download it from there: http://encosia.com/2011/02/04/a-vsdoc-for-jquery-1-5/ – Herb Feb 04 '11 at 22:27
  • Hi all, an update on my previous comment. Another problem is that Fire Query does not work, it does not show which events are bound to which elements. – samarjit samanta Feb 08 '11 at 04:12
23

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.

alt text

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 2
    According to a comment to a post today, Scott Guthrie is "following up with the team to understand what the latest status is on that." See http://weblogs.asp.net/scottgu/archive/2010/10/04/jquery-templates-data-link-and-globalization-accepted-as-official-jquery-plugins.aspx#7623375 Hopefully that means we'll see it at the above shortly. – James Skemp Oct 04 '10 at 22:35
  • Based on the fact that they still don't have any listed beyond 1.4.1, and that they specifically mention appendTo()'s in a recent blog post - http://blog.jquery.com/2010/11/23/jquery-community-updates-november2010/ - it's probably safe to assume this is no longer an effective way to grab the vsdoc. http://appendto.com/community/jquery-vsdoc – James Skemp Dec 06 '10 at 20:00
  • 2
    The jquery 1.4.4 docs have been released on microsoft cdn although still not showing on jquery website: http://www.asp.net/ajaxlibrary/cdn.ashx#jQuery_Releases_on_the_CDN_0 – Michael Dec 14 '10 at 09:23
  • Those Visual Studio links are no longer present – Rowland Shaw May 18 '15 at 15:52
12

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!

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);
        }
    },
John T
  • 2,687
  • 2
  • 27
  • 36
9

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

blueling
  • 2,003
  • 1
  • 17
  • 16
  • 2
    I think there may be errors with this file. If I use $(document).ready, I get an error on line 486: readyBound is not defined. – Josh Santangelo Aug 02 '10 at 17:34
  • 1
    Yeah, I compared it to the jquery-1.4.2.min-vsdoc.js that I created, using the above edits, and it's very different - missing lots of routines. – John T Aug 03 '10 at 15:27
  • @Josh: Agreed. This file is fubar - getting many script errors inside the jquery routines, readyBound/quickExpr/class2type is not defined etc... Is this a jquery or MS problem? – UpTheCreek Dec 08 '10 at 13:17
8

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.

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Art
  • 225
  • 3
  • 4
6

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.

See line# 224,

// The current version of jQuery being used
    jquery: "1.4.2",
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
6

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/

Hope that helps!

2

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.

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.

Mr Grok
  • 3,876
  • 5
  • 31
  • 40
2

John T said:

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

@John T: Thanks for the links!

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:

jQuery.proxy = function(function, context){

This causes Visual Studio to show the following error:

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

Update this line to read:

jQuery.proxy = function(method, context){

This bug was found and resolved in VS2008.

robyaw
  • 2,274
  • 2
  • 22
  • 29
1

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

Community
  • 1
  • 1
John T
  • 2,687
  • 2
  • 27
  • 36
  • It looks like MS might be paying appendTo to take this on. Of course, jQ 1.4.4 was released the same day... – Will Dean Nov 12 '10 at 11:25
1

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:

$.

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

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

This references the first function in my .js file:

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

   //My Function
};

})(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.

1

FWIW, you can generate for jQuery versions 1.4.2 and above using the online tool hosted at http://damianedwards.com/vsdoc

Also, the jQuery packages in NuGet contain vsdoc files generated using this tool.

This tool actually scrapes the official API documentation from api.jquery.com and merges it with the actual jQuery object in (browser) memory, rather than trying to do source merging. It's not 100% perfect, but it's very close (much closer than the old approach).

Also, judging by some of the answers and comments here, some people are actually reference the vsdoc file from their web pages. Do not do this. The vsdoc file is specifically built to service Visual Studio IntelliSense and will not work correctly in the browser. Just reference the actual jQuery file (or the .min version) and Visual Studio will automatically find the .vsdoc file version alongside it (including if you reference it from a CDN).

Damian Edwards
  • 7,289
  • 1
  • 25
  • 19
0

You can get it from here:

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

This is a web site hosted by Microsoft.

Note that if you need a newer version, say for jQuery 2.1.0, just change the version in above's path, i.e.:

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

and the download instantly starts.

Matt
  • 25,467
  • 18
  • 120
  • 187
0

this page contain a list of vsdoc files on microsoft's CDN

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

just search for vsdoc and u will find it :)

right now its not on official jquery download page

Karim
  • 6,113
  • 18
  • 58
  • 83
-1

Looks like they have added the 1.4.2 to the JQuery download page:

http://docs.jquery.com/Downloading_jQuery

NM was looking in the wrong spot

VoltaicShock
  • 842
  • 2
  • 7
  • 19