Вы всегда получаете его из http://docs.jquery.com/Downloading_jQuery - если его еще нет, значит, он недоступен еще. 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) вам, возможно, также придется изменить номер версии jQuery, используемый в 1.4.1-vsdoc.js файл в 1.4.2.
См. Строку № 224,
// The current version of jQuery being used
jquery: "1.4.2",
Любители приключений могут добавить следующие строки, начиная с 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",
Просто примечание к ответу Херба. Строка 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);
}
},
Я решил создать одну программу на основе ответов на этот вопрос и поделиться ею. Вы можете скачать его из этой записи блога:
http://hugeonion.com/2010/06/26/here-is-the-missing-jquery-1-4-2-vsdoc-file/
Надеюсь, это поможет!
Не уверен, что это "официальная версия", но теперь файл 1.4.2-vsdoc можно загрузить с Microsoft CDN: http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2-vsdoc.js