jQuery 1.4.2 の VSDoc はどこで入手できますか?
15 に答える
冒険好きな人は、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 Webページと、現在の「ライブ」と「ダイ」の定義からほとんど引き抜かれていますが、必要に応じて自由に調整してください。
また、224行目:
// The current version of jQuery being used
jquery: "1.4.2",
常にhttp://docs.jquery.com/Downloading_jQueryから取得します-まだ存在しない場合は、まだ利用できません。v1.4.1が存在します-スクリーンショットを参照してください-しかし、1.4.2はまだ準備ができていません。
ハーブの答えについてのメモ。とにかく、2940行目は「トリガー」メソッドの途中でした。2949 の後にコードを挿入しました。また、これら 2 つの新しいルーチンでコメントが機能しない理由を理解するのに約 45 分かかりました。「要約」タグに 'm' が 1 つ多すぎます!
修正版は次のとおりです。
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);
}
},
「公式バージョン」かどうかはわかりませんが、1.4.2-vsdoc ファイルが Microsoft CDN からダウンロードできるようになりました: http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2-vsdoc.js
この質問と回答からの入力に基づいて作成し、共有することにしました。次のブログ投稿からダウンロードできます。
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バージョンがリリースされたら、それを置き換えるだけです。
注: 次に、スクリプト ソース パスを変更し、vsdoc を取得するために vs を強制的に元に戻す必要がありました。src 属性値の先頭にスラッシュを追加してから削除しました。
ジョン T は次のように述べています。
それが価値があるものについて、そしてこの質問から:
jQuery 1.4.3 vsdoc
誰かが jQuery 1.4.3 の jQuery 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 で発見され、解決されました。
それが何の価値があるのか、そしてこの質問から:
誰かがjQuery1.4.3のjQueryvsdocを更新しました。それは次の場所にあります。
FWIW、 http://damianedwards.com/vsdocでホストされているオンラインツールを使用して、jQueryバージョン1.4.2以降用に生成できます
また、NuGetのjQueryパッケージには、このツールを使用して生成されたvsdocファイルが含まれています。
このツールは、実際にはapi.jquery.comから公式のAPIドキュメントを取得し、ソースのマージを試みるのではなく、(ブラウザーの)メモリ内の実際のjQueryオブジェクトとマージします。100%完璧というわけではありませんが、非常に近いです(古いアプローチよりもはるかに近いです)。
また、ここでの回答とコメントのいくつかから判断すると、実際にWebページからvsdocファイルを参照している人もいます。こんなことしないで。vsdocファイルは、Visual Studio IntelliSenseにサービスを提供するために特別に構築されており、ブラウザーでは正しく機能しません。実際のjQueryファイル(または.minバージョン)を参照するだけで、Visual Studioはその横にある.vsdocファイルのバージョンを自動的に検出します(CDNから参照する場合を含む)。
jQuery 1.4.4 とhttp://appendto.com/community/vsdocの vsdoc (および行 ~1750 の修正) を使用して、Intellisense をエラーなしで更新できます。ただし、入力するたびに:
$.
関連する Intelliprompts が表示されないだけでなく、次のように表示されます。
Javascript Intellisense メッセージ: JSIntellisense:Internal/(3:4) : Object required
これは、.js ファイルの最初の関数を参照します。
; (関数 ($) { $.fn.MobileFunction = 関数 (オプション) {
//My Function
};
})(jQuery);
警告が 1 つあります: })(jQuery); の最初の閉じ括弧に「Expected Expression」があります。しかし、コードに構文エラーが見つかりません。関数全体をコメントアウトしても、Intellisense は出力を生成しません。
このページには、Microsoft の CDN にある vsdoc ファイルのリストが含まれています。
http://www.asp.net/ajaxlibrary/cdn.ashx
vsdoc を検索するだけで見つかります :)
現在、公式のjqueryダウンロードページにはありません
ここから入手できます:
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.2-vsdoc.js
これはマイクロソフトがホストする Web サイトです。
jQuery 2.1.0などの新しいバージョンが必要な場合は、上記のパスのバージョンを変更するだけです。
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0-vsdoc.js
ダウンロードが即座に開始されます。