mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
AMD: Note on AMD best practices
Fixes #14687 Closes gh-1478 (cherry picked from commit 19220c0f29fa60d80a2beb76f048ffc8b972ba35) Conflicts: AUTHORS.txt
This commit is contained in:
parent
85ba301d09
commit
6d761984eb
@ -206,3 +206,4 @@ Jakob Stoeck <jakob@pokermania.de>
|
||||
cjqed <christopherjonesqed@gmail.com>
|
||||
Forbes Lindesay <forbes@lindesay.co.uk>
|
||||
John Paul <john@johnkpaul.com>
|
||||
S. Andrew Sheppard <andrew@wq.io>
|
||||
|
@ -9,6 +9,12 @@ define([
|
||||
// derived from file names, and jQuery is normally delivered in a lowercase
|
||||
// file name. Do this after creating the global so that if an AMD module wants
|
||||
// to call noConflict to hide this version of jQuery, it will work.
|
||||
|
||||
// Note that for maximum portability, libraries that are not jQuery should
|
||||
// declare themselves as anonymous modules, and avoid setting a global if an
|
||||
// AMD loader is present. jQuery is a special case. For more information, see
|
||||
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
define( "jquery", [], function() {
|
||||
return jQuery;
|
||||
|
Loading…
Reference in New Issue
Block a user