-
Notifications
You must be signed in to change notification settings - Fork 20
/
non-keywords.txt
1 lines (1 loc) · 281 KB
/
non-keywords.txt
1
a jQuery JavaScript Library v3 https jquery com Includes Sizzle js https sizzlejs com Copyright JS Foundation and other contributors Released under the MIT license https jquery org license Date T22 Z factory use strict exports For CommonJS and CommonJS like environments where a proper window present execute the factory and jQuery For environments that not have a window a document such Node js expose a factory exports This accentuates the need the creation a real window e g jQuery jquery window See ticket more info exports document factory w w document Error jQuery requires a window a document factory w factory Pass window not defined yet window window window noGlobal Edge Firefox IE Safari iOS exceptions when non strict code e g ASP NET accesses strict mode arguments callee caller trac But jQuery strict mode should be common enough that all such attempts are guarded a block use strict arr getProto Object getPrototypeOf slice arr slice flat arr flat array arr flat call array array arr concat apply array push arr push indexOf arr indexOf class2type toString class2type toString hasOwn class2type hasOwnProperty fnToString hasOwn toString ObjectFunctionString fnToString call Object support isFunction isFunction obj Support Chrome Firefox In some browsers returns HTML elements i e document createElement We don t want to classify DOM node a obj obj nodeType isWindow isWindow obj obj obj obj window document window document preservedScriptAttributes src nonce noModule DOMEval code node doc doc doc document i val script doc createElement script script text code node i preservedScriptAttributes Support Firefox Edge Some browsers don t support the nonce property on scripts On the other hand just using getAttribute not enough the nonce attribute reset to an empty whenever it becomes browsing context connected See https github com whatwg html issues See https html spec whatwg org nonce attributes The node getAttribute check was added the sake jQuery globalEval so that it can fake a nonce containing node via an val node i node getAttribute node getAttribute i val script setAttribute i val doc head appendChild script parentNode removeChild script toType obj obj obj Support Android only functionish RegExp obj obj class2type toString call obj obj Symbol Defining eslintrc json would create a danger using the unguarded another place it seems safer to define only version Define a local copy jQuery jQuery selector context The jQuery actually just the init enhanced Need init jQuery called just allow error to be thrown not included jQuery fn init selector context jQuery fn jQuery prototype The current version jQuery being used jquery version jQuery The length a jQuery length toArray slice call Get the Nth element the matched element OR Get the whole matched element a clean array num Return all the elements a clean array num slice call Return just the one element the num num length num Take an array elements and push it onto the stack returning the matched element pushStack elems Build a jQuery matched element ret jQuery merge elems Add the old onto the stack a reference ret prevObject Return the newly formed element ret Execute a callback every element the matched each callback jQuery each callback map callback pushStack jQuery map elem i callback call elem i elem slice pushStack slice apply arguments first eq last eq even pushStack jQuery grep _elem i i odd pushStack jQuery grep _elem i i eq i len length j i i len pushStack j j len j end prevObject For internal use only Behaves like an Array s method not like a jQuery method push push sort arr sort splice arr splice jQuery extend jQuery fn extend options name src copy copyIsArray clone target arguments i length arguments length deep Handle a deep copy situation target deep target Skip the and the target target arguments i i Handle when target a or something possible deep copy target isFunction target target Extend jQuery itself only one argument passed i length target i i length i Only deal non values options arguments i Extend the base name options copy options name Prevent Object prototype pollution Prevent ending loop name __proto__ target copy Recurse we re merging plain objects or arrays deep copy jQuery isPlainObject copy copyIsArray Array isArray copy src target name Ensure proper the source value copyIsArray Array isArray src clone copyIsArray jQuery isPlainObject src clone clone src copyIsArray Never move original objects clone them target name jQuery extend deep clone copy Don t bring values copy target name copy Return the modified target jQuery extend Unique each copy jQuery on the page expando jQuery version Math random replace D g Assume jQuery ready without the ready isReady error msg Error msg noop isPlainObject obj proto Ctor Detect obvious negatives Use toString instead jQuery to host objects obj toString call obj Object proto getProto obj Objects no prototype e g Object create are plain proto Objects prototype are plain iff they were constructed by a Object Ctor hasOwn call proto proto Ctor fnToString call Ctor ObjectFunctionString isEmptyObject obj name name obj Evaluates a script a provided context falls back to the one not specified globalEval code options doc DOMEval code nonce options options nonce doc each obj callback length i isArrayLike obj length obj length i length i callback call obj i i obj i i obj callback call obj i i obj i obj results internal usage only makeArray arr results ret results arr isArrayLike Object arr jQuery merge ret arr arr arr push call ret arr ret inArray elem arr i arr indexOf call arr elem i Support Android only PhantomJS only push apply _ arraylike throws on ancient WebKit merge first second len second length j i first length j len j first i second j first length i first grep elems callback invert callbackInverse matches i length elems length callbackExpect invert Go through the array only saving the items that pass the validator i length i callbackInverse callback elems i i callbackInverse callbackExpect matches push elems i matches arg internal usage only map elems callback arg length value i ret Go through the array translating each the items to their values isArrayLike elems length elems length i length i value callback elems i i arg value ret push value Go through every key on the i elems value callback elems i i arg value ret push value Flatten nested arrays flat ret A GUID counter objects guid jQuery support not used Core but other projects attach their properties to it so it needs to exist support support Symbol jQuery fn Symbol iterator arr Symbol iterator Populate the class2type map jQuery each Boolean Number String Function Array Date RegExp Object Error Symbol split _i name class2type name name toLowerCase isArrayLike obj Support real iOS only not reproducible simulator check used to prevent JIT error gh hasOwn isn t used here due to negatives regarding Nodelist length IE length obj length obj obj length toType obj isFunction obj isWindow obj array length length length length obj Sizzle Sizzle CSS Selector Engine v2 https sizzlejs com Copyright JS Foundation and other contributors Released under the MIT license https js foundation Date window i support Expr getText isXML tokenize compile select outermostContext sortInput hasDuplicate Local document vars setDocument document docElem documentIsHTML rbuggyQSA rbuggyMatches matches contains Instance specific data expando sizzle Date preferredDoc window document dirruns done classCache createCache tokenCache createCache compilerCache createCache nonnativeSelectorCache createCache sortOrder a b a b hasDuplicate Instance methods hasOwn hasOwnProperty arr pop arr pop pushNative arr push push arr push slice arr slice Use a stripped down indexOf it s faster than native https jsperf com thor indexof vs indexOf list elem i len list length i len i list i elem i booleans checked selected autofocus autoplay controls defer disabled hidden ismap loop multiple open required scoped Regular expressions http www w3 org TR css3 selectors whitespace whitespace x20 t r n f https www w3 org TR css syntax ident token diagram identifier da fA F whitespace r n f w x7f Attribute selectors http www w3 org TR selectors attribute selectors attributes whitespace identifier whitespace Operator capture whitespace Attribute values must be CSS identifiers capture or strings capture or capture identifier whitespace pseudos identifier To reduce the selectors needing tokenize the preFilter prefer arguments quoted capture capture or capture simple capture attributes anything capture Leading and non escaped trailing whitespace capturing some non whitespace characters preceding the latter rwhitespace RegExp whitespace g rtrim RegExp whitespace whitespace g rcomma RegExp whitespace whitespace rcombinators RegExp whitespace whitespace whitespace rdescend RegExp whitespace rpseudo RegExp pseudos ridentifier RegExp identifier matchExpr ID RegExp identifier CLASS RegExp identifier TAG RegExp identifier ATTR RegExp attributes PSEUDO RegExp pseudos CHILD RegExp only first last nth nth last child whitespace even odd d n whitespace whitespace d whitespace i bool RegExp booleans i For use libraries implementing We use POS matching select needsContext RegExp whitespace even odd eq gt lt nth first last whitespace d d whitespace i rhtml HTML i rinputs input select textarea button i rheader h d i rnative s native w Easily parseable retrievable ID or TAG or CLASS selectors rquickExpr w w w rsibling CSS escapes http www w3 org TR CSS21 syndata html escaped characters runescape RegExp da fA F whitespace r n f g funescape escape nonHex high x escape slice x10000 nonHex Strip the backslash prefix a non hex escape sequence nonHex Replace a hexadecimal escape sequence the encoded Unicode code point Support IE For values outside the Basic Multilingual Plane BMP manually construct a surrogate pair high String fromCharCode high x10000 String fromCharCode high xD800 high x3FF xDC00 CSS identifier serialization https drafts csswg org cssom common serializing idioms rcssescape x1f x7f d x1f x7f uFFFF w g fcssescape ch asCodePoint asCodePoint U NULL becomes U FFFD REPLACEMENT CHARACTER ch uFFFD Control characters and dependent upon position numbers escaped code points ch slice ch charCodeAt ch length toString Other potentially special ASCII characters backslash escaped ch Used iframes See setDocument Removing the wrapper causes a Permission Denied error IE unloadHandler setDocument inDisabledFieldset addCombinator elem elem disabled elem nodeName toLowerCase fieldset dir parentNode next legend Optimize push apply _ NodeList push apply arr slice call preferredDoc childNodes preferredDoc childNodes Support Android Detect silently failing push apply eslint disable next line no unused expressions arr preferredDoc childNodes length nodeType e push apply arr length Leverage slice possible target els pushNative apply target slice call els Support IE Otherwise append directly target els j target length i Can t trust NodeList length target j els i target length j Sizzle selector context results seed m i elem nid match groups newSelector newContext context context ownerDocument nodeType defaults to since context defaults to document nodeType context context nodeType results results Return early calls invalid selector or context selector selector nodeType nodeType nodeType results Try to shortcut find operations opposed to filters HTML documents seed setDocument context context context document documentIsHTML If the selector sufficiently simple using a By DOM method excepting DocumentFragment context where the methods don t exist nodeType match rquickExpr exec selector ID selector m match Document context nodeType elem context getElementById m Support IE Opera Webkit TODO identify versions getElementById can match elements by name instead ID elem id m results push elem results results Element context Support IE Opera Webkit TODO identify versions getElementById can match elements by name instead ID newContext elem newContext getElementById m contains context elem elem id m results push elem results Type selector match push apply results context getElementsByTagName selector results Class selector m match support getElementsByClassName context getElementsByClassName push apply results context getElementsByClassName m results Take advantage querySelectorAll support qsa nonnativeSelectorCache selector rbuggyQSA rbuggyQSA test selector Support IE only Exclude elements nodeType context nodeName toLowerCase newSelector selector newContext context qSA considers elements outside a scoping root when evaluating child or descendant combinators which not what we want In such cases we work around the behavior by prefixing every selector the list an ID selector referencing the scope context The technique has to be used well when a leading combinator used such selectors are not recognized by querySelectorAll Thanks to Andrew Dupont technique nodeType rdescend test selector rcombinators test selector Expand context sibling selectors newContext rsibling test selector testContext context parentNode context We can use scope instead the ID hack the browser supports it we re not changing the context newContext context support scope Capture the context ID setting it first necessary nid context getAttribute id nid nid replace rcssescape fcssescape context setAttribute id nid expando Prefix every selector the list groups tokenize selector i groups length i groups i nid nid scope toSelector groups i newSelector groups join push apply results newContext querySelectorAll newSelector results qsaError nonnativeSelectorCache selector nid expando context removeAttribute id All others select selector replace rtrim context results seed Create key value caches limited size returns Returns the Object data after storing it on itself property name the space suffixed and the cache larger than Expr cacheLength deleting the oldest entry createCache keys cache key value Use key to avoid collision native prototype properties see Issue keys push key Expr cacheLength Only keep the most recent entries cache keys shift cache key value cache Mark a special use by Sizzle param Function fn The to mark markFunction fn fn expando fn Support testing using an element param Function fn Passed the created element and returns a result fn el document createElement fieldset fn el e Remove its parent by el parentNode el parentNode removeChild el release memory IE el Adds the same handler all the specified attrs param String attrs Pipe separated list attributes param Function handler The method that will be applied addHandle attrs handler arr attrs split i arr length i Expr attrHandle arr i handler Checks document order two siblings param Element a param Element b returns Number Returns less than a precedes b greater than a follows b siblingCheck a b cur b a diff cur a nodeType b nodeType a sourceIndex b sourceIndex Use IE sourceIndex available on both nodes diff diff Check b follows a cur cur cur nextSibling cur b a Returns a to use pseudos input types param String createInputPseudo elem name elem nodeName toLowerCase name input elem Returns a to use pseudos buttons param String createButtonPseudo elem name elem nodeName toLowerCase name input name button elem Returns a to use pseudos enabled disabled param Boolean disabled disabled enabled createDisabledPseudo disabled Known disabled positives fieldset disabled legend nth n can disable elem Only certain elements can match enabled or disabled https html spec whatwg org multipage scripting html selector enabled https html spec whatwg org multipage scripting html selector disabled form elem Check inherited disabledness on relevant non disabled elements listed form associated elements a disabled fieldset https html spec whatwg org multipage forms html category listed https html spec whatwg org multipage forms html concept fe disabled option elements a disabled optgroup https html spec whatwg org multipage forms html concept option disabled All such elements have a form property elem parentNode elem disabled Option elements defer to a parent optgroup present label elem label elem parentNode elem parentNode disabled disabled elem disabled disabled Support IE Use the isDisabled shortcut property to check disabled fieldset ancestors elem isDisabled disabled Where there no isDisabled check manually jshint W018 elem isDisabled disabled inDisabledFieldset elem disabled elem disabled disabled Try to winnow elements that can t be disabled before trusting the disabled property Some victims caught our net label legend menu track but it shouldn t even exist on them alone have a value label elem elem disabled disabled Remaining elements are neither enabled nor disabled Returns a to use pseudos positionals param Function fn createPositionalPseudo fn markFunction argument argument argument markFunction seed matches j matchIndexes fn seed length argument i matchIndexes length Match elements found at the specified indexes i seed j matchIndexes i seed j matches j seed j Checks a node validity a Sizzle context param Element Object context returns Element Object Boolean The input node acceptable otherwise a falsy value testContext context context context getElementsByTagName context Expose support vars convenience support Sizzle support Detects XML nodes param Element Object elem An element or a document returns Boolean True iff elem a non HTML XML node isXML Sizzle isXML elem elem namespaceURI docElem elem ownerDocument elem documentElement Support IE Assume HTML when documentElement doesn t yet exist such inside loading iframes https bugs jquery com ticket rhtml test docElem docElem nodeName HTML Sets document related variables once based on the current document param Element Object doc An element or document to use to the document returns Object Returns the current document setDocument Sizzle setDocument node hasCompare subWindow doc node node ownerDocument node preferredDoc Return early doc invalid or already selected Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable next line eqeqeq doc document doc nodeType doc documentElement document Update variables document doc docElem document documentElement documentIsHTML isXML document Support IE Edge Accessing iframe documents after unload throws permission denied errors jQuery Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable next line eqeqeq preferredDoc document subWindow document defaultView subWindow top subWindow Support IE Edge subWindow addEventListener subWindow addEventListener unload unloadHandler Support IE only subWindow attachEvent subWindow attachEvent onunload unloadHandler Support IE Edge Chrome only Firefox only Safari only Opera x only IE Edge older browsers don t support the scope pseudo Support Safari only Safari supports scope but it s an alias root there support scope el docElem appendChild el appendChild document createElement div el querySelectorAll el querySelectorAll scope fieldset div length Attributes Support IE Verify that getAttribute really returns attributes and not properties excepting IE8 booleans support attributes el el className i el getAttribute className getElement s By Check getElementsByTagName returns only elements support getElementsByTagName el el appendChild document createComment el getElementsByTagName length Support IE support getElementsByClassName rnative test document getElementsByClassName Support IE Check getElementById returns elements by name The broken getElementById methods don t pick up programmatically names so use a roundabout getElementsByName test support getById el docElem appendChild el id expando document getElementsByName document getElementsByName expando length ID filter and find support getById Expr filter ID id attrId id replace runescape funescape elem elem getAttribute id attrId Expr find ID id context context getElementById documentIsHTML elem context getElementById id elem elem Expr filter ID id attrId id replace runescape funescape elem node elem getAttributeNode elem getAttributeNode id node node value attrId Support IE only getElementById not reliable a find shortcut Expr find ID id context context getElementById documentIsHTML node i elems elem context getElementById id elem Verify the id attribute node elem getAttributeNode id node node value id elem Fall back on getElementsByName elems context getElementsByName id i elem elems i node elem getAttributeNode id node node value id elem Tag Expr find TAG support getElementsByTagName tag context context getElementsByTagName context getElementsByTagName tag DocumentFragment nodes don t have gEBTN support qsa context querySelectorAll tag tag context elem tmp i By happy coincidence a broken gEBTN appears on DocumentFragment nodes too results context getElementsByTagName tag Filter possible comments tag elem results i elem nodeType tmp push elem tmp results Class Expr find CLASS support getElementsByClassName className context context getElementsByClassName documentIsHTML context getElementsByClassName className QSA matchesSelector QSA and matchesSelector support matchesSelector active reports when IE9 Opera rbuggyMatches qSa focus reports when Chrome We allow because a bug IE8 that throws an error whenever document activeElement accessed on an iframe So we allow focus to pass through QSA all the time to avoid the IE error See https bugs jquery com ticket rbuggyQSA support qsa rnative test document querySelectorAll Build QSA regex Regex strategy adopted Diego Perini el input Select to empty on purpose This to test IE s treatment not explicitly setting a content attribute since its presence should be enough https bugs jquery com ticket docElem appendChild el innerHTML a id expando a select id expando r msallowcapture option selected option select Support IE8 Opera Nothing should be selected when empty strings follow or or The test attribute must be Opera but safe WinRT https msdn microsoft com en us library ie hh465388 aspx attribute_section el querySelectorAll msallowcapture length rbuggyQSA push whitespace Support IE8 Boolean attributes and value are not treated correctly el querySelectorAll selected length rbuggyQSA push whitespace value booleans Support Chrome Android Safari iOS PhantomJS el querySelectorAll id expando length rbuggyQSA push Support IE Edge IE Edge don t find elements on a name query some cases Adding a temporary attribute to the document before the selection works around the issue Interestingly IE older don t seem to have the issue input document createElement input input setAttribute name el appendChild input el querySelectorAll name length rbuggyQSA push whitespace name whitespace whitespace Webkit Opera checked should selected option elements http www w3 org TR REC css3 selectors checked IE8 throws error here and will not see later tests el querySelectorAll checked length rbuggyQSA push checked Support Safari iOS https bugs webkit org show_bug cgi id In page selector id sibling combinator selector fails el querySelectorAll a expando length rbuggyQSA push Support Firefox only Old Firefox doesn t on a badly escaped identifier el querySelectorAll f rbuggyQSA push r n f el el innerHTML a href disabled disabled a select disabled disabled option select Support Windows Native Apps The and name attributes are restricted during innerHTML assignment input document createElement input input setAttribute hidden el appendChild input setAttribute name D Support IE8 Enforce sensitivity name attribute el querySelectorAll name d length rbuggyQSA push name whitespace FF enabled disabled and hidden elements hidden elements are still enabled IE8 throws error here and will not see later tests el querySelectorAll enabled length rbuggyQSA push enabled disabled Support IE9 IE s disabled selector does not pick up the children disabled fieldsets docElem appendChild el disabled el querySelectorAll disabled length rbuggyQSA push enabled disabled Support Opera only Opera does not on post comma invalid pseudos el querySelectorAll x rbuggyQSA push support matchesSelector rnative test matches docElem matches docElem webkitMatchesSelector docElem mozMatchesSelector docElem oMatchesSelector docElem msMatchesSelector el Check to see it s possible to matchesSelector on a disconnected node IE support disconnectedMatch matches call el This should fail an exception Gecko does not error returns instead matches call el s x rbuggyMatches push pseudos rbuggyQSA rbuggyQSA length RegExp rbuggyQSA join rbuggyMatches rbuggyMatches length RegExp rbuggyMatches join Contains hasCompare rnative test docElem compareDocumentPosition Element contains another Purposefully self exclusive As an element does not contain itself contains hasCompare rnative test docElem contains a b adown a nodeType a documentElement a bup b b parentNode a bup bup bup nodeType adown contains adown contains bup a compareDocumentPosition a compareDocumentPosition bup a b b b b parentNode b a Sorting Document order sorting sortOrder hasCompare a b Flag duplicate removal a b hasDuplicate Sort on method existence only one input has compareDocumentPosition compare a compareDocumentPosition b compareDocumentPosition compare compare Calculate position both inputs belong to the same document Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable next line eqeqeq compare a ownerDocument a b ownerDocument b a compareDocumentPosition b Otherwise we know they are disconnected Disconnected nodes compare support sortDetached b compareDocumentPosition a compare Choose the first element that related to our preferred document Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable next line eqeqeq a document a ownerDocument preferredDoc contains preferredDoc a Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable next line eqeqeq b document b ownerDocument preferredDoc contains preferredDoc b Maintain original order sortInput indexOf sortInput a indexOf sortInput b compare a b Exit early the nodes are identical a b hasDuplicate cur i aup a parentNode bup b parentNode ap a bp b Parentless nodes are either documents or disconnected aup bup Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable eqeqeq a document b document eslint enable eqeqeq aup bup sortInput indexOf sortInput a indexOf sortInput b If the nodes are siblings we can a quick check aup bup siblingCheck a b Otherwise we need full lists their ancestors comparison cur a cur cur parentNode ap unshift cur cur b cur cur parentNode bp unshift cur Walk down the tree looking a discrepancy ap i bp i i i Do a sibling check the nodes have a common ancestor siblingCheck ap i bp i Otherwise nodes our document sort first Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable eqeqeq ap i preferredDoc bp i preferredDoc eslint enable eqeqeq document Sizzle matches expr elements Sizzle expr elements Sizzle matchesSelector elem expr setDocument elem support matchesSelector documentIsHTML nonnativeSelectorCache expr rbuggyMatches rbuggyMatches test expr rbuggyQSA rbuggyQSA test expr ret matches call elem expr IE s matchesSelector returns on disconnected nodes ret support disconnectedMatch As well disconnected nodes are said to be a document fragment IE elem document elem document nodeType ret e nonnativeSelectorCache expr Sizzle expr document elem length Sizzle contains context elem Set document vars needed Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable next line eqeqeq context ownerDocument context document setDocument context contains context elem Sizzle attr elem name Set document vars needed Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable next line eqeqeq elem ownerDocument elem document setDocument elem fn Expr attrHandle name toLowerCase Don t fooled by Object prototype properties jQuery val fn hasOwn call Expr attrHandle name toLowerCase fn elem name documentIsHTML val val support attributes documentIsHTML elem getAttribute name val elem getAttributeNode name val specified val value Sizzle escape sel sel replace rcssescape fcssescape Sizzle error msg Error Syntax error unrecognized expression msg Document sorting and removing duplicates param ArrayLike results Sizzle uniqueSort results elem duplicates j i Unless we know we can detect duplicates assume their presence hasDuplicate support detectDuplicates sortInput support sortStable results slice results sort sortOrder hasDuplicate elem results i elem results i j duplicates push i j results splice duplicates j Clear input after sorting to release objects See https github com jquery sizzle pull sortInput results Utility retrieving the text value an array DOM nodes param Array Element elem getText Sizzle getText elem node ret i nodeType elem nodeType nodeType If no nodeType expected to be an array node elem i Do not traverse comment nodes ret getText node nodeType nodeType nodeType Use textContent elements innerText usage removed consistency lines jQuery elem textContent elem textContent Traverse its children elem elem firstChild elem elem elem nextSibling ret getText elem nodeType nodeType elem nodeValue Do not include comment or processing instruction nodes ret Expr Sizzle selectors Can be adjusted by the user cacheLength createPseudo markFunction match matchExpr attrHandle find relative dir parentNode first dir parentNode dir previousSibling first dir previousSibling preFilter ATTR match match match replace runescape funescape Move the given value to match whether quoted or unquoted match match match match replace runescape funescape match match match match slice CHILD match matches matchExpr CHILD only nth what child argument even odd d d n d xn component xn y argument d n sign xn component x xn component sign y component y y component match match toLowerCase match slice nth nth requires argument match Sizzle error match numeric x and y parameters Expr filter CHILD remember that cast respectively to match match match match match even match odd match match match match odd other types prohibit arguments match Sizzle error match match PSEUDO match excess unquoted match match matchExpr CHILD test match Accept quoted arguments match match match match Strip excess characters unquoted arguments unquoted rpseudo test unquoted Get excess tokenize recursively excess tokenize unquoted advance to the next closing parenthesis excess unquoted indexOf unquoted length excess unquoted length excess a negative index match match slice excess match unquoted slice excess Return only captures needed by the pseudo filter method and argument match slice filter TAG nodeNameSelector nodeName nodeNameSelector replace runescape funescape toLowerCase nodeNameSelector elem elem nodeName elem nodeName toLowerCase nodeName CLASS className pattern classCache className pattern pattern RegExp whitespace className whitespace classCache className elem pattern test elem className elem className elem getAttribute elem getAttribute ATTR name operator check elem result Sizzle attr elem name result operator operator result eslint disable max len operator result check operator result check operator check result indexOf check operator check result indexOf check operator check result slice check length check operator result replace rwhitespace indexOf check operator result check result slice check length check eslint enable max len CHILD what _argument first last simple slice nth forward slice last ofType what first last Shortcut nth n elem elem parentNode elem _context xml cache uniqueCache outerCache node nodeIndex start dir simple forward nextSibling previousSibling parent elem parentNode name ofType elem nodeName toLowerCase useCache xml ofType diff parent first last only child simple dir node elem node node dir ofType node nodeName toLowerCase name node nodeType Reverse direction only we haven t yet done so start dir only start nextSibling start forward parent firstChild parent lastChild non xml nth child stores cache data on parent forward useCache Seek elem a previously cached index a gzip friendly way node parent outerCache node expando node expando Support IE only Defend against cloned attroperties jQuery gh uniqueCache outerCache node uniqueID outerCache node uniqueID cache uniqueCache nodeIndex cache dirruns cache diff nodeIndex cache node nodeIndex parent childNodes nodeIndex node nodeIndex node node dir Fallback to seeking elem the start diff nodeIndex start pop When found cache indexes on parent and node nodeType diff node elem uniqueCache dirruns nodeIndex diff Use previously cached element index available useCache a gzip friendly way node elem outerCache node expando node expando Support IE only Defend against cloned attroperties jQuery gh uniqueCache outerCache node uniqueID outerCache node uniqueID cache uniqueCache nodeIndex cache dirruns cache diff nodeIndex xml nth child or nth last child or nth last diff Use the same loop above to seek elem the start node nodeIndex node node dir diff nodeIndex start pop ofType node nodeName toLowerCase name node nodeType diff Cache the index each encountered element useCache outerCache node expando node expando Support IE only Defend against cloned attroperties jQuery gh uniqueCache outerCache node uniqueID outerCache node uniqueID uniqueCache dirruns diff node elem Incorporate the offset then check against cycle size diff last diff first diff first diff first PSEUDO pseudo argument pseudo names are insensitive http www w3 org TR selectors pseudo classes Prioritize by sensitivity custom pseudos are added uppercase letters Remember that setFilters inherits pseudos args fn Expr pseudos pseudo Expr setFilters pseudo toLowerCase Sizzle error unsupported pseudo pseudo The user may use createPseudo to indicate that arguments are needed to create the filter just Sizzle does fn expando fn argument But maintain support old signatures fn length args pseudo pseudo argument Expr setFilters hasOwnProperty pseudo toLowerCase markFunction seed matches idx matched fn seed argument i matched length i idx indexOf seed matched i seed idx matches idx matched i elem fn elem args fn pseudos Potentially complex pseudos not markFunction selector Trim the selector passed to compile to avoid treating leading and trailing spaces combinators input results matcher compile selector replace rtrim matcher expando markFunction seed matches _context xml elem unmatched matcher seed xml i seed length Match elements unmatched by matcher i elem unmatched i seed i matches i elem elem _context xml input elem matcher input xml results Don t keep the element issue input results pop has markFunction selector elem Sizzle selector elem length contains markFunction text text text replace runescape funescape elem elem textContent getText elem indexOf text Whether an element represented by a lang selector based solely on the element s language value being equal to the identifier C or beginning the identifier C immediately followed by The matching C against the element s language value performed insensitively The identifier C does not have to be a valid language name http www w3 org TR selectors lang pseudo lang markFunction lang lang value must be a valid identifier ridentifier test lang Sizzle error unsupported lang lang lang lang replace runescape funescape toLowerCase elem elemLang elemLang documentIsHTML elem lang elem getAttribute xml lang elem getAttribute lang elemLang elemLang toLowerCase elemLang lang elemLang indexOf lang elem elem parentNode elem nodeType Miscellaneous target elem hash window location window location hash hash hash slice elem id root elem elem docElem focus elem elem document activeElement document hasFocus document hasFocus elem elem href elem tabIndex Boolean properties enabled createDisabledPseudo disabled createDisabledPseudo checked elem In CSS3 checked should both checked and selected elements http www w3 org TR REC css3 selectors checked nodeName elem nodeName toLowerCase nodeName input elem checked nodeName option elem selected selected elem Accessing property makes selected by options Safari work properly elem parentNode eslint disable next line no unused expressions elem parentNode selectedIndex elem selected Contents empty elem http www w3 org TR selectors empty pseudo empty negated by element or content nodes text cdata entity ref but not by others comment processing instruction etc nodeType works because attributes not appear children elem elem firstChild elem elem elem nextSibling elem nodeType parent elem Expr pseudos empty elem Element input types header elem rheader test elem nodeName input elem rinputs test elem nodeName button elem name elem nodeName toLowerCase name input elem button name button text elem attr elem nodeName toLowerCase input elem text Support IE New HTML5 attribute values e g search appear elem text attr elem getAttribute attr toLowerCase text Position collection first createPositionalPseudo last createPositionalPseudo _matchIndexes length length eq createPositionalPseudo _matchIndexes length argument argument argument length argument even createPositionalPseudo matchIndexes length i i length i matchIndexes push i matchIndexes odd createPositionalPseudo matchIndexes length i i length i matchIndexes push i matchIndexes lt createPositionalPseudo matchIndexes length argument i argument argument length argument length length argument i matchIndexes push i matchIndexes gt createPositionalPseudo matchIndexes length argument i argument argument length argument i length matchIndexes push i matchIndexes Expr pseudos nth Expr pseudos eq Add button input pseudos i radio checkbox file password image Expr pseudos i createInputPseudo i i submit reset Expr pseudos i createButtonPseudo i Easy API creating setFilters setFilters setFilters prototype Expr filters Expr pseudos Expr setFilters setFilters tokenize Sizzle tokenize selector parseOnly matched match tokens soFar groups preFilters cached tokenCache selector cached parseOnly cached slice soFar selector groups preFilters Expr preFilter soFar Comma and first run matched match rcomma exec soFar match Don t consume trailing commas valid soFar soFar slice match length soFar groups push tokens matched Combinators match rcombinators exec soFar matched match shift tokens push value matched Cast descendant combinators to space match replace rtrim soFar soFar slice matched length Filters Expr filter match matchExpr exec soFar preFilters match preFilters match matched match shift tokens push value matched matches match soFar soFar slice matched length matched Return the length the invalid excess we re just parsing Otherwise an error or tokens parseOnly soFar length soFar Sizzle error selector Cache the tokens tokenCache selector groups slice toSelector tokens i len tokens length selector i len i selector tokens i value selector addCombinator matcher combinator base dir combinator dir skip combinator next key skip dir checkNonElements base key parentNode doneName done combinator first Check against closest ancestor preceding element elem context xml elem elem dir elem nodeType checkNonElements matcher elem context xml Check against all ancestor preceding elements elem context xml oldCache uniqueCache outerCache newCache dirruns doneName We can t arbitrary data on XML nodes so they don t benefit combinator caching xml elem elem dir elem nodeType checkNonElements matcher elem context xml elem elem dir elem nodeType checkNonElements outerCache elem expando elem expando Support IE only Defend against cloned attroperties jQuery gh uniqueCache outerCache elem uniqueID outerCache elem uniqueID skip skip elem nodeName toLowerCase elem elem dir elem oldCache uniqueCache key oldCache dirruns oldCache doneName Assign to newCache so results back propagate to previous elements newCache oldCache Reuse newcache so results back propagate to previous elements uniqueCache key newCache A match means we re done a fail means we have to keep checking newCache matcher elem context xml elementMatcher matchers matchers length elem context xml i matchers length i matchers i elem context xml matchers multipleContexts selector contexts results i len contexts length i len i Sizzle selector contexts i results results condense unmatched map filter context xml elem newUnmatched i len unmatched length mapped map i len i elem unmatched i filter filter elem context xml newUnmatched push elem mapped map push i newUnmatched setMatcher preFilter selector matcher postFilter postFinder postSelector postFilter postFilter expando postFilter setMatcher postFilter postFinder postFinder expando postFinder setMatcher postFinder postSelector markFunction seed results context xml temp i elem preMap postMap preexisting results length Get initial elements seed or context elems seed multipleContexts selector context nodeType context context Prefilter to matcher input preserving a map seed results synchronization matcherIn preFilter seed selector condense elems preMap preFilter context xml elems matcherOut matcher If we have a postFinder or filtered seed or non seed postFilter or preexisting results postFinder seed preFilter preexisting postFilter intermediate processing necessary otherwise use results directly results matcherIn Find primary matches matcher matcher matcherIn matcherOut context xml Apply postFilter postFilter temp condense matcherOut postMap postFilter temp context xml Un match failing elements by moving them back to matcherIn i temp length i elem temp i matcherOut postMap i matcherIn postMap i elem seed postFinder preFilter postFinder Get the final matcherOut by condensing intermediate into postFinder contexts temp i matcherOut length i elem matcherOut i Restore matcherIn since elem not yet a final match temp push matcherIn i elem postFinder matcherOut temp xml Move matched elements seed to results to keep them synchronized i matcherOut length i elem matcherOut i temp postFinder indexOf seed elem preMap i seed temp results temp elem Add elements to results through postFinder defined matcherOut condense matcherOut results matcherOut splice preexisting matcherOut length matcherOut postFinder postFinder results matcherOut xml push apply results matcherOut matcherFromTokens tokens checkContext matcher j len tokens length leadingRelative Expr relative tokens implicitRelative leadingRelative Expr relative i leadingRelative The foundational matcher ensures that elements are reachable top level context s matchContext addCombinator elem elem checkContext implicitRelative matchAnyContext addCombinator elem indexOf checkContext elem implicitRelative matchers elem context xml ret leadingRelative xml context outermostContext checkContext context nodeType matchContext elem context xml matchAnyContext elem context xml Avoid hanging onto element issue checkContext ret i len i matcher Expr relative tokens i matchers addCombinator elementMatcher matchers matcher matcher Expr filter tokens i apply tokens i matches Return special upon seeing a positional matcher matcher expando Find the next relative operator proper handling j i j len j Expr relative tokens j setMatcher i elementMatcher matchers i toSelector If the preceding token was a descendant combinator insert an implicit element tokens slice i concat value tokens i replace rtrim matcher i j matcherFromTokens tokens slice i j j len matcherFromTokens tokens tokens slice j j len toSelector tokens matchers push matcher elementMatcher matchers matcherFromGroupMatchers elementMatchers setMatchers bySet setMatchers length byElement elementMatchers length superMatcher seed context xml results outermost elem j matcher matchedCount i unmatched seed setMatched contextBackup outermostContext We must always have either seed elements or outermost context elems seed byElement Expr find TAG outermost Use integer dirruns iff the outermost matcher dirrunsUnique dirruns contextBackup Math random len elems length outermost Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable next line eqeqeq outermostContext context document context outermost Add elements passing elementMatchers directly to results Support IE Safari Tolerate NodeList properties IE length Safari matching elements by id i len elem elems i i byElement elem j Support IE Edge IE Edge sometimes a Permission denied error when strict comparing two documents shallow comparisons work eslint disable next line eqeqeq context elem ownerDocument document setDocument elem xml documentIsHTML matcher elementMatchers j matcher elem context document xml results push elem outermost dirruns dirrunsUnique Track unmatched elements filters bySet They will have gone through all possible matchers elem matcher elem matchedCount Lengthen the array every element matched or not seed unmatched push elem i now the count elements visited above and adding it to matchedCount makes the latter nonnegative matchedCount i Apply filters to unmatched elements NOTE This can be skipped there are no unmatched elements i e matchedCount equals i unless we didn t visit _any_ elements the above loop because we have no element matchers and no seed Incrementing an initially i allows i to remain a only that which will result a matchedCount that differs i but also numerically zero bySet i matchedCount j matcher setMatchers j matcher unmatched setMatched context xml seed Reintegrate element matches to eliminate the need sorting matchedCount i unmatched i setMatched i setMatched i pop call results Discard index placeholder values to only actual matches setMatched condense setMatched Add matches to results push apply results setMatched Seedless matches succeeding multiple successful matchers stipulate sorting outermost seed setMatched length matchedCount setMatchers length Sizzle uniqueSort results Override manipulation globals by nested matchers outermost dirruns dirrunsUnique outermostContext contextBackup unmatched bySet markFunction superMatcher superMatcher compile Sizzle compile selector match Internal Use Only i setMatchers elementMatchers cached compilerCache selector cached Generate a recursive functions that can be used to check each element match match tokenize selector i match length i cached matcherFromTokens match i cached expando setMatchers push cached elementMatchers push cached Cache the compiled cached compilerCache selector matcherFromGroupMatchers elementMatchers setMatchers Save selector and tokenization cached selector selector cached A low level selection that works Sizzle s compiled selector functions param String Function selector A selector or a pre compiled selector built Sizzle compile param Element context param Array results param Array seed A elements to match against select Sizzle select selector context results seed i tokens token find compiled selector selector match seed tokenize selector compiled selector selector results results Try to minimize operations there only one selector the list and no seed the latter which guarantees us context match length Reduce context the leading compound selector an ID tokens match match slice tokens length token tokens ID context nodeType documentIsHTML Expr relative tokens context Expr find ID token matches replace runescape funescape context context results Precompiled matchers will still verify ancestry so step up a level compiled context context parentNode selector selector slice tokens shift value length Fetch a seed right to left matching i matchExpr needsContext test selector tokens length i token tokens i Abort we hit a combinator Expr relative token find Expr find Search expanding context leading sibling combinators seed find token matches replace runescape funescape rsibling test tokens testContext context parentNode context If seed empty or no tokens remain we can early tokens splice i selector seed length toSelector tokens selector push apply results seed results Compile and execute a filtering one not provided Provide match to avoid retokenization we modified the selector above compiled compile selector match seed context documentIsHTML results context rsibling test selector testContext context parentNode context results One time assignments Sort stability support sortStable expando split sort sortOrder join expando Support Chrome Always assume duplicates they aren t passed to the comparison support detectDuplicates hasDuplicate Initialize against the document setDocument Support Webkit Safari Chrome fixed Chrome Detached nodes confoundingly follow each other support sortDetached el Should but returns following el compareDocumentPosition document createElement fieldset Support IE Prevent attribute property interpolation https msdn microsoft com en us library ms536429 VS aspx el el innerHTML a href a el firstChild getAttribute href addHandle href height width elem name isXML isXML elem getAttribute name name toLowerCase Support IE Use defaultValue place getAttribute value support attributes el el innerHTML input el firstChild setAttribute value el firstChild getAttribute value addHandle value elem _name isXML isXML elem nodeName toLowerCase input elem defaultValue Support IE Use getAttributeNode to fetch booleans when getAttribute lies el el getAttribute disabled addHandle booleans elem name isXML val isXML elem name name toLowerCase val elem getAttributeNode name val specified val value Sizzle window jQuery find Sizzle jQuery expr Sizzle selectors Deprecated jQuery expr jQuery expr pseudos jQuery uniqueSort jQuery Sizzle uniqueSort jQuery text Sizzle getText jQuery isXMLDoc Sizzle isXML jQuery contains Sizzle contains jQuery escapeSelector Sizzle escape dir elem dir until matched truncate until elem elem dir elem nodeType elem nodeType truncate jQuery elem until matched push elem matched siblings n elem matched n n n nextSibling n nodeType n elem matched push n matched rneedsContext jQuery expr match needsContext nodeName elem name elem nodeName elem nodeName toLowerCase name toLowerCase rsingleTag a z x20 t r n f x20 t r n f i Implement the identical functionality filter and not winnow elements qualifier not isFunction qualifier jQuery grep elements elem i qualifier call elem i elem not Single element qualifier nodeType jQuery grep elements elem elem qualifier not Arraylike elements jQuery arguments Array qualifier jQuery grep elements elem indexOf call qualifier elem not Filtered directly both simple and complex selectors jQuery filter qualifier elements not jQuery filter expr elems not elem elems not expr not expr elems length elem nodeType jQuery find matchesSelector elem expr elem jQuery find matches expr jQuery grep elems elem elem nodeType jQuery fn extend find selector i ret len length self selector pushStack jQuery selector filter i i len i jQuery contains self i ret pushStack i i len i jQuery find selector self i ret len jQuery uniqueSort ret ret filter selector pushStack winnow selector not selector pushStack winnow selector selector winnow If a positional relative selector check membership the returned so p first p last won t a doc two p selector rneedsContext test selector jQuery selector selector length Initialize a jQuery A central reference to the root jQuery document rootjQuery A simple way to check HTML strings Prioritize id over tag to avoid XSS via location hash Strict HTML recognition must start Shortcut simple id speed rquickExpr s w W w init jQuery fn init selector context root match elem HANDLE selector Method init accepts an alternate rootjQuery so migrate can support jQuery sub gh root root rootjQuery Handle HTML strings selector selector selector selector length selector length Assume that strings that start and end are HTML and skip the regex check match selector match rquickExpr exec selector Match html or make sure no context specified id match match context HANDLE html array match context context jQuery context context Option to run scripts back compat Intentionally the error be thrown parseHTML not present jQuery merge jQuery parseHTML match context context nodeType context ownerDocument context document HANDLE html props rsingleTag test match jQuery isPlainObject context match context Properties context are called methods possible isFunction match match context match and otherwise attributes attr match context match HANDLE id elem document getElementById match elem Inject the element directly into the jQuery elem length HANDLE expr context context jquery context root find selector HANDLE expr context which just equivalent to context find expr context find selector HANDLE DOMElement selector nodeType selector length HANDLE Shortcut document ready isFunction selector root ready root ready selector Execute immediately ready not present selector jQuery jQuery makeArray selector Give the init the jQuery prototype later instantiation init prototype jQuery fn Initialize central reference rootjQuery jQuery document rparentsprev parents prev Until All Methods guaranteed to produce a when starting a guaranteedUnique children contents next prev jQuery fn extend has target targets jQuery target l targets length filter i i l i jQuery contains targets i closest selectors context cur i l length matched targets selectors jQuery selectors Positional selectors match since there s no _selection_ context rneedsContext test selectors i l i cur i cur cur context cur cur parentNode Always skip document fragments cur nodeType targets targets index cur Don t pass non elements to Sizzle cur nodeType jQuery find matchesSelector cur selectors matched push cur pushStack matched length jQuery uniqueSort matched matched Determine the position an element within the index elem No argument index parent elem parentNode first prevAll length Index selector elem indexOf call jQuery elem Locate the position the desired element indexOf call If it receives a jQuery the first element used elem jquery elem elem add selector context pushStack jQuery uniqueSort jQuery merge jQuery selector context addBack selector add selector prevObject prevObject filter selector sibling cur dir cur cur dir cur nodeType cur jQuery each parent elem parent elem parentNode parent parent nodeType parent parents elem dir elem parentNode parentsUntil elem _i until dir elem parentNode until next elem sibling elem nextSibling prev elem sibling elem previousSibling nextAll elem dir elem nextSibling prevAll elem dir elem previousSibling nextUntil elem _i until dir elem nextSibling until prevUntil elem _i until dir elem previousSibling until siblings elem siblings elem parentNode firstChild elem children elem siblings elem firstChild contents elem elem contentDocument Support IE elements no data attribute has an contentDocument a prototype getProto elem contentDocument elem contentDocument Support IE only iOS only Android Browser only Treat the template element a regular one browsers that don t support it nodeName elem template elem elem content elem jQuery merge elem childNodes name fn jQuery fn name until selector matched jQuery map fn until name slice Until selector until selector selector matched jQuery filter selector matched length Remove duplicates guaranteedUnique name jQuery uniqueSort matched Reverse order parents and prev derivatives rparentsprev test name matched reverse pushStack matched rnothtmlwhite x20 t r n f g Convert String formatted options into Object formatted ones createOptions options jQuery each options match rnothtmlwhite _ flag flag Create a callback list using the following parameters options an optional list space separated options that will change how the callback list behaves or a more traditional option By a callback list will act like an event callback list and can be fired multiple times Possible options once will ensure the callback list can only be fired once like a Deferred memory will keep track previous values and will call callback added after the list has been fired right away the latest memorized values like a Deferred will ensure a callback can only be added once no duplicate the list stopOnFalse interrupt callings when a callback returns jQuery Callbacks options Convert options String formatted to Object formatted needed we check cache first options options createOptions options jQuery extend options Flag to know list currently firing firing Last fire value non forgettable lists memory Flag to know list was already fired fired Flag to prevent firing locked Actual callback list list Queue execution data repeatable lists queue Index currently firing callback modified by add remove needed firingIndex Fire callbacks fire Enforce single firing locked locked options once Execute callbacks all pending executions respecting firingIndex overrides and runtime changes fired firing queue length firingIndex memory queue shift firingIndex list length Run callback and check early termination list firingIndex apply memory memory options stopOnFalse Jump to end and forget the data so add doesn t re fire firingIndex list length memory Forget the data we re done it options memory memory firing Clean up we re done firing good locked Keep an empty list we have data future add calls memory list Otherwise spent list Actual Callbacks self Add a callback or a collection callbacks to the list add list If we have memory a past run we should fire after adding memory firing firingIndex list length queue push memory add args jQuery each args _ arg isFunction arg options self has arg list push arg arg arg length toType arg Inspect recursively add arg arguments memory firing fire Remove a callback the list remove jQuery each arguments _ arg index index jQuery inArray arg list index list splice index Handle firing indexes index firingIndex firingIndex Check a given callback the list If no argument given whether or not list has callbacks attached has fn fn jQuery inArray fn list list length Remove all callbacks the list empty list list Disable fire and add Abort current pending executions Clear all callbacks and values disable locked queue list memory disabled list Disable fire Also disable add unless we have memory since it would have no effect Abort pending executions lock locked queue memory firing list memory locked locked Call all callbacks the given context and arguments fireWith context args locked args args args context args slice args slice args queue push args firing fire Call all the callbacks the given arguments fire self fireWith arguments To know the callbacks have already been called at least once fired fired self Identity v v Thrower ex ex adoptValue value resolve reject noValue method Check promise aspect first to privilege synchronous behavior value isFunction method value promise method call value done resolve fail reject Other thenables value isFunction method value then method call value resolve reject Other non thenables Control resolve arguments by letting Array slice cast noValue to integer value slice resolve value value slice resolve resolve apply value slice noValue For Promises A convert exceptions into rejections Since jQuery when doesn t unwrap thenables we can skip the extra checks appearing Deferred then to conditionally suppress rejection value Support Android only Strict mode functions invoked without call apply context reject apply value jQuery extend Deferred func tuples action add listener callbacks then handlers argument index final state notify progress jQuery Callbacks memory jQuery Callbacks memory resolve done jQuery Callbacks once memory jQuery Callbacks once memory resolved reject fail jQuery Callbacks once memory jQuery Callbacks once memory rejected state pending promise state state always deferred done arguments fail arguments fn promise then fn Keep pipe back compat pipe fnDone fnFail fnProgress fns arguments jQuery Deferred newDefer jQuery each tuples _i tuple Map tuples progress done fail to arguments done fail progress fn isFunction fns tuple fns tuple deferred progress bind to newDefer or newDefer notify deferred done bind to newDefer or newDefer resolve deferred fail bind to newDefer or newDefer reject deferred tuple returned fn fn apply arguments returned isFunction returned promise returned promise progress newDefer notify done newDefer resolve fail newDefer reject newDefer tuple With fn returned arguments fns promise then onFulfilled onRejected onProgress maxDepth resolve depth deferred handler special that args arguments mightThrow returned then Support Promises A section https promisesaplus com point Ignore double resolution attempts depth maxDepth returned handler apply that args Support Promises A section https promisesaplus com point returned deferred promise TypeError Thenable self resolution Support Promises A sections https promisesaplus com point https promisesaplus com point Retrieve then only once then returned Support Promises A section https promisesaplus com point Only check objects and functions thenability returned returned returned then Handle a returned thenable isFunction then Special processors notify just wait resolution special then call returned resolve maxDepth deferred Identity special resolve maxDepth deferred Thrower special Normal processors resolve also hook into progress and disregard older resolution values maxDepth then call returned resolve maxDepth deferred Identity special resolve maxDepth deferred Thrower special resolve maxDepth deferred Identity deferred notifyWith Handle all other returned values Only substitute handlers pass on context and multiple values non spec behavior handler Identity that args returned Process the value s Default process resolve special deferred resolveWith that args Only normal processors resolve and reject exceptions process special mightThrow mightThrow e jQuery Deferred exceptionHook jQuery Deferred exceptionHook e process stackTrace Support Promises A section https promisesaplus com point Ignore post resolution exceptions depth maxDepth Only substitute handlers pass on context and multiple values non spec behavior handler Thrower that args e deferred rejectWith that args Support Promises A section https promisesaplus com point Re resolve promises immediately to dodge rejection subsequent errors depth process Call an optional hook to record the stack exception since it s otherwise lost when execution goes jQuery Deferred getStackHook process stackTrace jQuery Deferred getStackHook window setTimeout process jQuery Deferred newDefer progress_handlers add tuples add resolve newDefer isFunction onProgress onProgress Identity newDefer notifyWith fulfilled_handlers add tuples add resolve newDefer isFunction onFulfilled onFulfilled Identity rejected_handlers add tuples add resolve newDefer isFunction onRejected onRejected Thrower promise Get a promise deferred If obj provided the promise aspect added to the promise obj obj jQuery extend obj promise promise deferred Add list specific methods jQuery each tuples i tuple list tuple stateString tuple promise progress list add promise done list add promise fail list add promise tuple list add Handle state stateString list add state resolved i e fulfilled state rejected state stateString rejected_callbacks disable fulfilled_callbacks disable tuples i disable rejected_handlers disable fulfilled_handlers disable tuples i disable progress_callbacks lock tuples lock progress_handlers lock tuples lock progress_handlers fire fulfilled_handlers fire rejected_handlers fire list add tuple fire deferred notify deferred notifyWith deferred resolve deferred resolveWith deferred reject deferred rejectWith deferred tuple deferred tuple With deferred arguments deferred notifyWith list fireWith deferred resolveWith list fireWith deferred rejectWith list fireWith deferred tuple With list fireWith Make the deferred a promise promise promise deferred Call given func func func call deferred deferred All done deferred Deferred helper when singleValue count uncompleted subordinates remaining arguments length count unprocessed arguments i remaining subordinate fulfillment data resolveContexts Array i resolveValues slice call arguments the master Deferred master jQuery Deferred subordinate callback factory updateFunc i value resolveContexts i resolveValues i arguments length slice call arguments value remaining master resolveWith resolveContexts resolveValues Single and empty arguments are adopted like Promise resolve remaining adoptValue singleValue master done updateFunc i resolve master reject remaining Use then to unwrap secondary thenables cf gh master state pending isFunction resolveValues i resolveValues i then master then Multiple arguments are aggregated like Promise all array elements i adoptValue resolveValues i updateFunc i master reject master promise These usually indicate a programmer mistake during development warn about them ASAP rather than swallowing them by rerrorNames Eval Internal Range Reference Syntax Type URI Error jQuery Deferred exceptionHook error stack Support IE only Console exists when dev tools are open which can happen at time window console window console warn error rerrorNames test error name window console warn jQuery Deferred exception error message error stack stack jQuery readyException error window setTimeout error The deferred used on DOM ready readyList jQuery Deferred jQuery fn ready fn readyList then fn Wrap jQuery readyException a so that the lookup happens at the time error handling instead callback registration error jQuery readyException error jQuery extend Is the DOM ready to be used Set to once it occurs isReady A counter to track how many items to wait before the ready event fires See readyWait Handle when the DOM ready ready wait Abort there are pending holds or we re already ready wait jQuery readyWait jQuery isReady Remember that the DOM ready jQuery isReady If a normal DOM Ready event fired decrement and wait need be wait jQuery readyWait If there are functions bound to execute readyList resolveWith document jQuery jQuery ready then readyList then The ready event handler and self cleanup method completed document removeEventListener DOMContentLoaded completed window removeEventListener load completed jQuery ready Catch cases where document ready called after the browser event has already occurred Support IE only Older IE sometimes signals interactive too soon document readyState complete document readyState loading document documentElement doScroll Handle it asynchronously to allow scripts the opportunity to delay ready window setTimeout jQuery ready Use the handy event callback document addEventListener DOMContentLoaded completed A fallback to window onload that will always work window addEventListener load completed Multifunctional method to and values a collection The value s can optionally be executed it s a access elems fn key value chainable emptyGet raw i len elems length bulk key Sets many values toType key chainable i key access elems fn i key i emptyGet raw Sets one value value chainable isFunction value raw bulk Bulk operations run against the entire raw fn call elems value fn except when executing values bulk fn fn elem _key value bulk call jQuery elem value fn i len i fn elems i key raw value value call elems i i fn elems i key chainable elems Gets bulk fn call elems len fn elems key emptyGet Matches dashed camelizing rmsPrefix ms rdashAlpha a z g Used by camelCase callback to replace fcamelCase _all letter letter toUpperCase Convert dashed to camelCase used by the css and data modules Support IE Edge Microsoft forgot to hump their vendor prefix camelCase replace rmsPrefix ms replace rdashAlpha fcamelCase acceptData owner Accepts only Node Node ELEMENT_NODE Node DOCUMENT_NODE Object Any owner nodeType owner nodeType owner nodeType Data expando jQuery expando Data uid Data uid Data prototype cache owner Check the owner already has a cache value owner expando If not create one value value We can accept data non element nodes modern browsers but we should not see Always an empty acceptData owner If it a node unlikely to be stringify ed or looped over use plain assignment owner nodeType owner expando value Otherwise secure it a non enumerable property configurable must be to allow the property to be deleted when data removed Object defineProperty owner expando value value configurable value owner data value prop cache cache owner Handle owner key value args Always use camelCase key gh data cache camelCase data value Handle owner properties args Copy the properties one by one to the cache prop data cache camelCase prop data prop cache owner key key cache owner Always use camelCase key gh owner expando owner expando camelCase key access owner key value In cases where either No key was specified A key was specified but no value provided Take the read path and allow the method to determine which value to respectively either The entire cache The data stored at the key key key key value owner key When the key not a or both a key and value are specified or extend existing objects either An properties A key and value owner key value Since the path can have two possible entry points the expected data based on which path was taken value value key remove owner key i cache owner expando cache key Support array or space separated keys Array isArray key If key an array keys We always camelCase keys so remove that key key map camelCase key camelCase key If a key the spaces exists use it Otherwise create an array by matching non whitespace key key cache key key match rnothtmlwhite i key length i cache key i Remove the expando there s no more data key jQuery isEmptyObject cache Support Chrome Webkit Blink performance suffers when deleting properties DOM nodes so to instead https bugs chromium org p chromium issues detail id bug restricted owner nodeType owner expando owner expando hasData owner cache owner expando cache jQuery isEmptyObject cache dataPriv Data dataUser Data Implementation Summary Enforce API surface and semantic compatibility x branch Improve the s maintainability by reducing the storage paths to a single mechanism Use the same single mechanism to support and user data _Never_ expose data to user code TODO Drop _data _removeData Avoid exposing implementation details on user objects eg expando properties Provide a clear path implementation upgrade to WeakMap rbrace w W w W rmultiDash A Z g getData data data data data Only convert to a it doesn t change the data data data rbrace test data JSON parse data data dataAttr elem key data name If nothing was found internally to fetch data the HTML5 data attribute data elem nodeType name data key replace rmultiDash toLowerCase data elem getAttribute name data data getData data e Make sure we the data so it isn t changed later dataUser elem key data data data jQuery extend hasData elem dataUser hasData elem dataPriv hasData elem data elem name data dataUser access elem name data removeData elem name dataUser remove elem name TODO Now that all calls to _data and _removeData have been replaced direct calls to dataPriv methods these can be deprecated _data elem name data dataPriv access elem name data _removeData elem name dataPriv remove elem name jQuery fn extend data key value i name data elem attrs elem elem attributes Gets all values key length data dataUser elem elem nodeType dataPriv elem hasDataAttrs i attrs length i Support IE only The attrs elements can be attrs i name attrs i name name indexOf data name camelCase name slice dataAttr elem name data name dataPriv elem hasDataAttrs data Sets multiple values key each dataUser key access value data The calling jQuery element matches not empty and therefore has an element appears at and the value parameter was not An empty jQuery will result elem which will an exception an attempt to read a data cache made elem value Attempt to data the cache The key will always be camelCased Data data dataUser elem key data data Attempt to discover the data HTML5 custom data attrs data dataAttr elem key data data We tried really hard but the data doesn t exist Set the data each We always store the camelCased key dataUser key value value arguments length removeData key each dataUser remove key jQuery extend queue elem data queue elem fx queue queue dataPriv elem Speed up dequeue by getting quickly just a lookup data queue Array isArray data queue dataPriv access elem jQuery makeArray data queue push data queue dequeue elem fx queue jQuery queue elem startLength queue length fn queue shift hooks jQuery _queueHooks elem next jQuery dequeue elem If the fx queue dequeued always remove the progress sentinel fn inprogress fn queue shift startLength fn Add a progress sentinel to prevent the fx queue being automatically dequeued fx queue unshift inprogress Clear up the last queue stop hooks stop fn call elem next hooks startLength hooks hooks empty fire Not generate a queueHooks or the current one _queueHooks elem key queueHooks dataPriv elem key dataPriv access elem key empty jQuery Callbacks once memory add dataPriv remove elem queue key jQuery fn extend queue data setter data fx setter arguments length setter jQuery queue data each queue jQuery queue data Ensure a hooks queue jQuery _queueHooks fx queue inprogress jQuery dequeue dequeue each jQuery dequeue clearQueue queue fx Get a promise resolved when queues a certain are emptied fx the by promise obj tmp count defer jQuery Deferred elements i length resolve count defer resolveWith elements elements obj fx i tmp dataPriv elements i queueHooks tmp tmp empty count tmp empty add resolve resolve defer promise obj pnum d d eE d source rcssNum RegExp pnum a z i cssExpand Top Right Bottom Left documentElement document documentElement isAttached elem jQuery contains elem ownerDocument elem composed composed Support IE Edge iOS only Check attachment across shadow DOM boundaries when possible gh Support iOS only Early iOS versions support attachShadow but not getRootNode leading to errors We need to check getRootNode documentElement getRootNode isAttached elem jQuery contains elem ownerDocument elem elem getRootNode composed elem ownerDocument isHiddenWithinTree elem el isHiddenWithinTree might be called jQuery filter that element will be second argument elem el elem Inline style trumps all elem style display none elem style display Otherwise check computed style Support Firefox Disconnected elements can have computed display none so first confirm that elem the document isAttached elem jQuery css elem display none adjustCSS elem prop valueParts tween adjusted scale maxIterations currentValue tween tween cur jQuery css elem prop initial currentValue unit valueParts valueParts jQuery cssNumber prop px Starting value computation required potential unit mismatches initialInUnit elem nodeType jQuery cssNumber prop unit px initial rcssNum exec jQuery css elem prop initialInUnit initialInUnit unit Support Firefox Halve the iteration target value to prevent interference CSS upper bounds gh initial initial Trust units reported by jQuery css unit unit initialInUnit Iteratively approximate a nonzero starting point initialInUnit initial maxIterations Evaluate and update our best guess doubling guesses that zero Finish the scale equals or crosses making the old product non positive jQuery style elem prop initialInUnit unit scale scale currentValue initial maxIterations initialInUnit initialInUnit scale initialInUnit initialInUnit jQuery style elem prop initialInUnit unit Make sure we update the tween properties later on valueParts valueParts valueParts initialInUnit initialInUnit initial Apply relative offset specified adjusted valueParts initialInUnit valueParts valueParts valueParts tween tween unit unit tween start initialInUnit tween end adjusted adjusted defaultDisplayMap getDefaultDisplay elem temp doc elem ownerDocument nodeName elem nodeName display defaultDisplayMap nodeName display display temp doc body appendChild doc createElement nodeName display jQuery css temp display temp parentNode removeChild temp display none display block defaultDisplayMap nodeName display display showHide elements show display elem values index length elements length Determine display value elements that need to change index length index elem elements index elem style display elem style display show Since we force visibility upon cascade hidden elements an immediate and slow check required first loop unless we have a nonempty display value either inline or about to be restored display none values index dataPriv elem display values index elem style display elem style display isHiddenWithinTree elem values index getDefaultDisplay elem display none values index none Remember what we re overwriting dataPriv elem display display Set the display the elements a second loop to avoid constant reflow index index length index values index elements index style display values index elements jQuery fn extend show showHide hide showHide toggle state state state show hide each isHiddenWithinTree jQuery show jQuery hide rcheckableType checkbox radio i rtagName a z x20 t r n f i rscriptType java ecma script i fragment document createDocumentFragment div fragment appendChild document createElement div input document createElement input Support Android only Check state lost the name Support Windows Web Apps WWA name and must use setAttribute WWA input setAttribute radio input setAttribute checked checked input setAttribute name t div appendChild input Support Android only Older WebKit doesn t clone checked state correctly fragments support checkClone div cloneNode cloneNode lastChild checked Support IE only Make sure textarea and checkbox defaultValue properly cloned div innerHTML textarea x textarea support noCloneChecked div cloneNode lastChild defaultValue Support IE only IE replaces option tags their contents when inserted outside the select element div innerHTML option option support option div lastChild We have to close these tags to support XHTML wrapMap XHTML parsers not magically insert elements the same way that tag soup parsers So we cannot shorten by omitting tbody or other required elements thead table table col table colgroup colgroup table tr table tbody tbody table td table tbody tr tr tbody table _default wrapMap tbody wrapMap tfoot wrapMap colgroup wrapMap caption wrapMap thead wrapMap th wrapMap td Support IE only support option wrapMap optgroup wrapMap option select multiple multiple select getAll context tag Support IE only Use to avoid zero argument method invocation on host objects ret context getElementsByTagName ret context getElementsByTagName tag context querySelectorAll ret context querySelectorAll tag ret tag tag nodeName context tag jQuery merge context ret ret Mark scripts having already been evaluated setGlobalEval elems refElements i l elems length i l i dataPriv elems i globalEval refElements dataPriv refElements i globalEval rhtml w buildFragment elems context scripts selection ignored elem tmp tag wrap attached j fragment context createDocumentFragment nodes i l elems length i l i elem elems i elem elem Add nodes directly toType elem Support Android only PhantomJS only push apply _ arraylike throws on ancient WebKit jQuery merge nodes elem nodeType elem elem Convert non html into a text node rhtml test elem nodes push context createTextNode elem Convert html into DOM nodes tmp tmp fragment appendChild context createElement div Deserialize a standard representation tag rtagName exec elem toLowerCase wrap wrapMap tag wrapMap _default tmp innerHTML wrap jQuery htmlPrefilter elem wrap Descend through wrappers to the right content j wrap j tmp tmp lastChild Support Android only PhantomJS only push apply _ arraylike throws on ancient WebKit jQuery merge nodes tmp childNodes Remember the top level container tmp fragment firstChild Ensure the created nodes are orphaned tmp textContent Remove wrapper fragment fragment textContent i elem nodes i Skip elements already the context collection trac selection jQuery inArray elem selection ignored ignored push elem attached isAttached elem Append to fragment tmp getAll fragment appendChild elem script Preserve script evaluation history attached setGlobalEval tmp Capture executables scripts j elem tmp j rscriptType test elem scripts push elem fragment rkeyEvent key rmouseEvent mouse pointer contextmenu drag drop click rtypenamespace returnTrue returnFalse Support IE focus and blur are asynchronous except when they are no op So expect focus to be synchronous when the element already active and blur to be synchronous when the element not already active focus and blur are always synchronous other supported browsers just defines when we can count on it expectSync elem elem safeActiveElement focus Support IE only Accessing document activeElement can unexpectedly https bugs jquery com ticket safeActiveElement document activeElement err on elem types selector data fn one origFn Types can be a map types handlers types types Object selector data selector types Object data data data selector selector types on elem selector data types one elem data fn types fn fn selector data selector fn selector types selector fn fn data data types data fn fn data data selector selector fn fn returnFalse fn elem one origFn fn fn event Can use an empty since event contains the info jQuery off event origFn apply arguments Use same guid so caller can remove using origFn fn guid origFn guid origFn guid jQuery guid elem each jQuery event add types fn data selector Helper functions managing events not part the Props to Dean Edwards addEvent library many the ideas jQuery event add elem types handler data selector handleObjIn eventHandle tmp events t handleObj special handlers namespaces origType elemData dataPriv elem Only attach events to objects that accept data acceptData elem Caller can pass an custom data lieu the handler handler handler handleObjIn handler handler handleObjIn handler selector handleObjIn selector Ensure that invalid selectors exceptions at attach time Evaluate against documentElement elem a non element node e g document selector jQuery find matchesSelector documentElement selector Make sure that the handler has a ID used to find remove it later handler guid handler guid jQuery guid Init the element s event structure and main handler the first events elemData events events elemData events Object create eventHandle elemData handle eventHandle elemData handle e Discard the second event a jQuery event trigger and when an event called after a page has unloaded jQuery jQuery event triggered e jQuery event dispatch apply elem arguments Handle multiple events separated by a space types types match rnothtmlwhite t types length t tmp rtypenamespace exec types t origType tmp namespaces tmp split sort There must be a no attaching only handlers If event changes its use the special event handlers the changed special jQuery event special If selector defined determine special event api otherwise given selector special delegateType special bindType Update special based on newly reset special jQuery event special handleObj passed to all event handlers handleObj jQuery extend origType origType data data handler handler guid handler guid selector selector needsContext selector jQuery expr match needsContext test selector namespaces join handleObjIn Init the event handler queue we re the first handlers events handlers events handlers delegateCount Only use addEventListener the special events handler returns special setup special setup call elem data namespaces eventHandle elem addEventListener elem addEventListener eventHandle special add special add call elem handleObj handleObj handler guid handleObj handler guid handler guid Add to the element s handler list delegates front selector handlers splice handlers delegateCount handleObj handlers push handleObj Keep track which events have ever been used event optimization jQuery event Detach an event or events an element remove elem types handler selector mappedTypes j origCount tmp events t handleObj special handlers namespaces origType elemData dataPriv hasData elem dataPriv elem elemData events elemData events Once each types may be omitted types types match rnothtmlwhite t types length t tmp rtypenamespace exec types t origType tmp namespaces tmp split sort Unbind all events on provided the element events jQuery event remove elem types t handler selector special jQuery event special selector special delegateType special bindType handlers events tmp tmp RegExp namespaces join Remove matching events origCount j handlers length j handleObj handlers j mappedTypes origType handleObj origType handler handler guid handleObj guid tmp tmp test handleObj selector selector handleObj selector selector handleObj selector handlers splice j handleObj selector handlers delegateCount special remove special remove call elem handleObj Remove generic event handler we removed something and no more handlers exist avoids potential endless recursion during removal special event handlers origCount handlers length special teardown special teardown call elem namespaces elemData handle jQuery removeEvent elem elemData handle events Remove data and the expando it s no longer used jQuery isEmptyObject events dataPriv remove elem handle events dispatch nativeEvent i j ret matched handleObj handlerQueue args Array arguments length Make a writable jQuery Event the native event event jQuery event fix nativeEvent handlers dataPriv events Object create event special jQuery event special event Use the fix ed jQuery Event rather than the read only native event args event i i arguments length i args i arguments i event delegateTarget Call the preDispatch hook the mapped and it bail desired special preDispatch special preDispatch call event Determine handlers handlerQueue jQuery event handlers call event handlers Run delegates first they may want to stop propagation beneath us i matched handlerQueue i event isPropagationStopped event currentTarget matched elem j handleObj matched handlers j event isImmediatePropagationStopped If the event namespaced then each handler only invoked it specially universal or its namespaces are a superset the event s event rnamespace handleObj event rnamespace test handleObj event handleObj handleObj event data handleObj data ret jQuery event special handleObj origType handle handleObj handler apply matched elem args ret event result ret event preventDefault event stopPropagation Call the postDispatch hook the mapped special postDispatch special postDispatch call event event result handlers event handlers i handleObj sel matchedHandlers matchedSelectors handlerQueue delegateCount handlers delegateCount cur event target Find delegate handlers delegateCount Support IE Black hole SVG use instance trees trac cur nodeType Support Firefox Suppress spec violating clicks indicating a non primary pointer button trac https www w3 org TR DOM Level Events event click Support IE only but not arrow key clicks radio inputs which can have button gh event click event button cur cur cur parentNode Don t check non elements Don t process clicks on disabled elements cur nodeType event click cur disabled matchedHandlers matchedSelectors i i delegateCount i handleObj handlers i Don t conflict Object prototype properties sel handleObj selector matchedSelectors sel matchedSelectors sel handleObj needsContext jQuery sel index cur jQuery find sel cur length matchedSelectors sel matchedHandlers push handleObj matchedHandlers length handlerQueue push elem cur handlers matchedHandlers Add the remaining directly bound handlers cur delegateCount handlers length handlerQueue push elem cur handlers handlers slice delegateCount handlerQueue addProp name hook Object defineProperty jQuery Event prototype name enumerable configurable isFunction hook originalEvent hook originalEvent originalEvent originalEvent name value Object defineProperty name enumerable configurable writable value value fix originalEvent originalEvent jQuery expando originalEvent jQuery Event originalEvent special load Prevent triggered image load events bubbling to window load noBubble click Utilize native event to ensure correct state checkable inputs setup data For mutual compressibility _default replace access a local data dead code meant only to preserve the variable through minification el data Claim the first handler rcheckableType test el el click nodeName el input dataPriv el click leverageNative el click returnTrue Return to allow normal processing the caller trigger data For mutual compressibility _default replace access a local data dead code meant only to preserve the variable through minification el data Force setup before triggering a click rcheckableType test el el click nodeName el input leverageNative el click Return non to allow normal event path propagation For cross browser consistency suppress native click on links Also prevent it we re currently inside a leveraged native event stack _default event target event target rcheckableType test target target click nodeName target input dataPriv target click nodeName target a beforeunload postDispatch event Support Firefox Firefox doesn t alert the returnValue field not event result event originalEvent event originalEvent returnValue event result Ensure the presence an event listener that handles manually triggered synthetic events by interrupting progress until reinvoked response to native events that it fires directly ensuring that state changes have already occurred before other listeners are invoked leverageNative el expectSync Missing expectSync indicates a trigger call which must force setup through jQuery event add expectSync dataPriv el jQuery event add el returnTrue Register the controller a special universal handler all event namespaces dataPriv el jQuery event add el handler event notAsync result saved dataPriv event isTrigger Interrupt processing the outer synthetic trigger ed event Saved data should be such cases but might be a leftover capture an native handler gh saved length Store arguments use when handling the inner native event There will always be at least one argument an event so array will not be confused a leftover capture saved slice call arguments dataPriv saved Trigger the native event and capture its result Support IE focus and blur are asynchronous notAsync expectSync result dataPriv saved result notAsync dataPriv result saved result Cancel the outer synthetic event event stopImmediatePropagation event preventDefault result value If an inner synthetic event an event a bubbling surrogate focus or blur assume that the surrogate already propagated triggering the native event and prevent that happening again here This technically gets the ordering wrong w r t to trigger which the bubbling surrogate propagates after the non bubbling base but that seems less bad than duplication jQuery event special delegateType event stopPropagation If a native event triggered above everything now order Fire an inner synthetic event the original arguments saved length and capture the result dataPriv value jQuery event trigger Support IE Extend the prototype to reset the above stopImmediatePropagation jQuery extend saved jQuery Event prototype saved slice Abort handling the native event event stopImmediatePropagation jQuery removeEvent elem handle This needed plain objects elem removeEventListener elem removeEventListener handle jQuery Event src props Allow instantiation without the keyword jQuery Event jQuery Event src props Event src src originalEvent src src Events bubbling up the document may have been marked prevented by a handler lower down the tree reflect the correct value isDefaultPrevented src defaultPrevented src defaultPrevented Support Android only src returnValue returnTrue returnFalse Create target properties Support Safari only Target should not be a text node target src target src target nodeType src target parentNode src target currentTarget src currentTarget relatedTarget src relatedTarget Event src Put explicitly provided properties onto the event props jQuery extend props Create a timestamp incoming event doesn t have one timeStamp src src timeStamp Date now Mark it fixed jQuery expando jQuery Event based on DOM3 Events specified by the ECMAScript Language Binding https www w3 org TR WD DOM Level Events ecma script binding html jQuery Event prototype jQuery Event isDefaultPrevented returnFalse isPropagationStopped returnFalse isImmediatePropagationStopped returnFalse isSimulated preventDefault e originalEvent isDefaultPrevented returnTrue e isSimulated e preventDefault stopPropagation e originalEvent isPropagationStopped returnTrue e isSimulated e stopPropagation stopImmediatePropagation e originalEvent isImmediatePropagationStopped returnTrue e isSimulated e stopImmediatePropagation stopPropagation Includes all common event props including KeyEvent and MouseEvent specific props jQuery each altKey bubbles cancelable changedTouches ctrlKey detail eventPhase metaKey pageX pageY shiftKey view char code charCode key keyCode button buttons clientX clientY offsetX offsetY pointerId pointerType screenX screenY targetTouches toElement touches which event button event button Add which key events event which rkeyEvent test event event charCode event charCode event keyCode Add which click left middle right event which button rmouseEvent test event button button button event which jQuery event addProp jQuery each focus focusin blur focusout delegateType jQuery event special Utilize native event possible so blur focus sequence correct setup Claim the first handler dataPriv focus dataPriv blur leverageNative expectSync Return to allow normal processing the caller trigger Force setup before trigger leverageNative Return non to allow normal event path propagation delegateType delegateType Create mouseenter leave events using mouseover and event time checks so that event delegation works jQuery Do the same pointerenter pointerleave and pointerover pointerout Support Safari only Safari sends mouseenter too often see https bugs chromium org p chromium issues detail id the description the bug it existed older Chrome versions well jQuery each mouseenter mouseover mouseleave mouseout pointerenter pointerover pointerleave pointerout orig fix jQuery event special orig delegateType fix bindType fix handle event ret target related event relatedTarget handleObj event handleObj For mouseenter leave call the handler related outside the target NB No relatedTarget the mouse left entered the browser window related related target jQuery contains target related event handleObj origType ret handleObj handler apply arguments event fix ret jQuery fn extend on types selector data fn on types selector data fn one types selector data fn on types selector data fn off types selector fn handleObj types types preventDefault types handleObj event dispatched jQuery Event handleObj types handleObj jQuery types delegateTarget off handleObj handleObj origType handleObj handleObj origType handleObj selector handleObj handler types types selector types off selector types selector selector types fn fn selector selector fn fn returnFalse each jQuery event remove types fn selector Support IE Edge only In IE Edge using regex groups here causes severe slowdowns See https connect microsoft com IE feedback details rnoInnerhtml script style link i checked checked or checked rchecked checked s s checked i rcleanScript s CDATA s g Prefer a tbody over its parent table containing rows manipulationTarget elem content nodeName elem table nodeName content nodeType content content firstChild tr jQuery elem children tbody elem elem Replace restore the attribute script elements safe DOM manipulation disableScript elem elem elem getAttribute elem elem restoreScript elem elem slice elem elem slice elem removeAttribute elem cloneCopyEvent src dest i l pdataOld udataOld udataCur events dest nodeType Copy data events handlers etc dataPriv hasData src pdataOld dataPriv src events pdataOld events events dataPriv remove dest handle events events i l events length i l i jQuery event add dest events i Copy user data dataUser hasData src udataOld dataUser access src udataCur jQuery extend udataOld dataUser dest udataCur Fix IE bugs see support tests fixInput src dest nodeName dest nodeName toLowerCase Fails to persist the checked state a cloned checkbox or radio button nodeName input rcheckableType test src dest checked src checked Fails to the selected option to the selected state when cloning options nodeName input nodeName textarea dest defaultValue src defaultValue domManip collection args callback ignored Flatten nested arrays args flat args fragment first scripts hasScripts node doc i l collection length iNoClone l value args valueIsFunction isFunction value We can t cloneNode fragments that contain checked WebKit valueIsFunction l value support checkClone rchecked test value collection each index self collection eq index valueIsFunction args value call index self html domManip self args callback ignored l fragment buildFragment args collection ownerDocument collection ignored first fragment firstChild fragment childNodes length fragment first Require either content or an interest ignored elements to invoke the callback first ignored scripts jQuery map getAll fragment script disableScript hasScripts scripts length Use the original fragment the last item instead the first because it can end up being emptied incorrectly certain situations i l i node fragment i iNoClone node jQuery clone node Keep references to cloned scripts later restoration hasScripts Support Android only PhantomJS only push apply _ arraylike throws on ancient WebKit jQuery merge scripts getAll node script callback call collection i node i hasScripts doc scripts scripts length ownerDocument Reenable scripts jQuery map scripts restoreScript Evaluate executable scripts on first document insertion i i hasScripts i node scripts i rscriptType test node dataPriv access node globalEval jQuery contains doc node node src node toLowerCase Optional AJAX dependency but won t run scripts not present jQuery _evalUrl node noModule jQuery _evalUrl node src nonce node nonce node getAttribute nonce doc DOMEval node textContent replace rcleanScript node doc collection remove elem selector keepData node nodes selector jQuery filter selector elem elem i node nodes i i keepData node nodeType jQuery cleanData getAll node node parentNode keepData isAttached node setGlobalEval getAll node script node parentNode removeChild node elem jQuery extend htmlPrefilter html html clone elem dataAndEvents deepDataAndEvents i l srcElements destElements clone elem cloneNode inPage isAttached elem Fix IE cloning issues support noCloneChecked elem nodeType elem nodeType jQuery isXMLDoc elem We eschew Sizzle here performance reasons https jsperf com getall vs sizzle destElements getAll clone srcElements getAll elem i l srcElements length i l i fixInput srcElements i destElements i Copy the events the original to the clone dataAndEvents deepDataAndEvents srcElements srcElements getAll elem destElements destElements getAll clone i l srcElements length i l i cloneCopyEvent srcElements i destElements i cloneCopyEvent elem clone Preserve script evaluation history destElements getAll clone script destElements length setGlobalEval destElements inPage getAll elem script Return the cloned clone cleanData elems data elem special jQuery event special i elem elems i i acceptData elem data elem dataPriv expando data events data events special jQuery event remove elem This a shortcut to avoid jQuery event remove s overhead jQuery removeEvent elem data handle Support Chrome Assign instead using see Data remove elem dataPriv expando elem dataUser expando Support Chrome Assign instead using see Data remove elem dataUser expando jQuery fn extend detach selector remove selector remove selector remove selector text value access value value jQuery text empty each nodeType nodeType nodeType textContent value value arguments length append domManip arguments elem nodeType nodeType nodeType target manipulationTarget elem target appendChild elem prepend domManip arguments elem nodeType nodeType nodeType target manipulationTarget elem target insertBefore elem target firstChild before domManip arguments elem parentNode parentNode insertBefore elem after domManip arguments elem parentNode parentNode insertBefore elem nextSibling empty elem i elem i i elem nodeType Prevent memory leaks jQuery cleanData getAll elem Remove remaining nodes elem textContent clone dataAndEvents deepDataAndEvents dataAndEvents dataAndEvents dataAndEvents deepDataAndEvents deepDataAndEvents dataAndEvents deepDataAndEvents map jQuery clone dataAndEvents deepDataAndEvents html value access value elem i l length value elem nodeType elem innerHTML See we can take a shortcut and just use innerHTML value rnoInnerhtml test value wrapMap rtagName exec value toLowerCase value jQuery htmlPrefilter value i l i elem i Remove element nodes and prevent memory leaks elem nodeType jQuery cleanData getAll elem elem innerHTML value elem If using innerHTML throws an exception use the fallback method e elem empty append value value arguments length replaceWith ignored Make the changes replacing each non ignored context element the content domManip arguments elem parent parentNode jQuery inArray ignored jQuery cleanData getAll parent parent replaceChild elem Force callback invocation ignored jQuery each appendTo append prependTo prepend insertBefore before insertAfter after replaceAll replaceWith name original jQuery fn name selector elems ret insert jQuery selector last insert length i i last i elems i last clone jQuery insert i original elems Support Android only PhantomJS only because push apply _ arraylike throws on ancient WebKit push apply ret elems pushStack ret rnumnonpx RegExp pnum px a z i getStyles elem Support IE only Firefox IE throws on elements created popups FF meanwhile throws on frame elements through defaultView getComputedStyle view elem ownerDocument defaultView view view opener view window view getComputedStyle elem swap elem options callback ret name old Remember the old values and insert the ones name options old name elem style name elem style name options name ret callback call elem Revert the old values name options elem style name old name ret rboxStyle RegExp cssExpand join i Executing both pixelPosition boxSizingReliable tests only one layout so they re executed at the same time to save the second computation computeStyleTests This a singleton we need to execute it only once div container style cssText position absolute left px width px margin top px padding border div style cssText position relative display block box sizing border box overflow scroll margin auto border px padding px width top documentElement appendChild container appendChild div divStyle window getComputedStyle div pixelPositionVal divStyle top Support Android only Firefox reliableMarginLeftVal roundPixelMeasures divStyle marginLeft Support Android only Safari iOS Some styles come back percentage values even though they shouldn t div style right pixelBoxStylesVal roundPixelMeasures divStyle right Support IE only Detect misreporting content dimensions box sizing border box elements boxSizingReliableVal roundPixelMeasures divStyle width Support IE only Detect overflow scroll screwiness gh Support Chrome Don t tricked when zoom affects offsetWidth gh div style position absolute scrollboxSizeVal roundPixelMeasures div offsetWidth documentElement removeChild container Nullify the div so it wouldn t be stored the memory and it will also be a sign that checks already performed div roundPixelMeasures measure Math round parseFloat measure pixelPositionVal boxSizingReliableVal scrollboxSizeVal pixelBoxStylesVal reliableTrDimensionsVal reliableMarginLeftVal container document createElement div div document createElement div Finish early limited non browser environments div style Support IE only Style cloned element affects source element cloned div style backgroundClip content box div cloneNode style backgroundClip support clearCloneStyle div style backgroundClip content box jQuery extend support boxSizingReliable computeStyleTests boxSizingReliableVal pixelBoxStyles computeStyleTests pixelBoxStylesVal pixelPosition computeStyleTests pixelPositionVal reliableMarginLeft computeStyleTests reliableMarginLeftVal scrollboxSize computeStyleTests scrollboxSizeVal Support IE Edge IE Edge misreport getComputedStyle table rows width height CSS offset properties report correct values Behavior IE more subtle than newer versions it passes some versions test make sure not to make it pass there reliableTrDimensions table tr trChild trStyle reliableTrDimensionsVal table document createElement table tr document createElement tr trChild document createElement div table style cssText position absolute left px tr style height px trChild style height px documentElement appendChild table appendChild tr appendChild trChild trStyle window getComputedStyle tr reliableTrDimensionsVal parseInt trStyle height documentElement removeChild table reliableTrDimensionsVal curCSS elem name computed width minWidth maxWidth ret Support Firefox Retrieving style before computed somehow fixes an issue getting wrong values on detached elements style elem style computed computed getStyles elem getPropertyValue needed css filter IE only css customProperty computed ret computed getPropertyValue name computed name ret isAttached elem ret jQuery style elem name A tribute to the awesome hack by Dean Edwards Android Browser returns percentage some values but width seems to be reliably pixels This against the CSSOM draft spec https drafts csswg org cssom resolved values support pixelBoxStyles rnumnonpx test ret rboxStyle test name Remember the original values width style width minWidth style minWidth maxWidth style maxWidth Put the values to a computed value style minWidth style maxWidth style width ret ret computed width Revert the changed values style width width style minWidth minWidth style maxWidth maxWidth ret Support IE only IE returns zIndex value an integer ret ret addGetHookIf conditionFn hookFn Define the hook we ll check on the first run it s really needed conditionFn Hook not needed or it s not possible to use it due to missing dependency remove it Hook needed redefine it so that the support test not executed again hookFn apply arguments cssPrefixes Webkit Moz ms emptyStyle document createElement div style vendorProps Return a vendor prefixed property or vendorPropName name Check vendor prefixed names capName name toUpperCase name slice i cssPrefixes length i name cssPrefixes i capName name emptyStyle name Return a potentially mapped jQuery cssProps or vendor prefixed property finalPropName name final jQuery cssProps name vendorProps name final final name emptyStyle name vendorProps name vendorPropName name name Swappable display none or starts table except table table cell or table caption See here display values https developer mozilla org en US docs CSS display rdisplayswap none table c ea rcustomProp cssShow position absolute visibility hidden display block cssNormalTransform letterSpacing fontWeight setPositiveNumber _elem value subtract Any relative values have already been normalized at point matches rcssNum exec value matches Guard against subtract e g when used cssHooks Math max matches subtract matches px value boxModelAdjustment elem dimension box isBorderBox styles computedVal i dimension width extra delta Adjustment may not be necessary box isBorderBox border content i i Both box models exclude margin box margin delta jQuery css elem box cssExpand i styles If we here a content box we re seeking padding or border or margin isBorderBox Add padding delta jQuery css elem padding cssExpand i styles For border or margin add border box padding delta jQuery css elem border cssExpand i Width styles But still keep track it otherwise extra jQuery css elem border cssExpand i Width styles If we here a border box content padding border we re seeking content or padding or margin For content subtract padding box content delta jQuery css elem padding cssExpand i styles For content or padding subtract border box margin delta jQuery css elem border cssExpand i Width styles Account positive content box scroll gutter when requested by providing computedVal isBorderBox computedVal offsetWidth offsetHeight a rounded sum content padding scroll gutter and border Assuming integer scroll gutter subtract the rest and round down delta Math max Math ceil elem offset dimension toUpperCase dimension slice computedVal delta extra If offsetWidth offsetHeight then we can t determine content box scroll gutter Use an explicit zero to avoid NaN gh delta getWidthOrHeight elem dimension extra Start computed style styles getStyles elem To avoid forcing a reflow only fetch boxSizing we need it gh Fake content box until we know it s needed to know the value boxSizingNeeded support boxSizingReliable extra isBorderBox boxSizingNeeded jQuery css elem boxSizing styles border box valueIsBorderBox isBorderBox val curCSS elem dimension styles offsetProp offset dimension toUpperCase dimension slice Support Firefox Return a confounding non pixel value or feign ignorance appropriate rnumnonpx test val extra val val auto Support IE only Use offsetWidth offsetHeight when box sizing unreliable In those cases the computed value can be trusted to be border box support boxSizingReliable isBorderBox Support IE Edge IE Edge misreport getComputedStyle table rows width height CSS offset properties report correct values Interestingly some cases IE doesn t suffer issue support reliableTrDimensions nodeName elem tr Fall back to offsetWidth offsetHeight when value auto This happens inline elements no explicit setting gh val auto Support Android only Also use offsetWidth offsetHeight misreported inline dimensions gh parseFloat val jQuery css elem display styles inline Make sure the element visible connected elem getClientRects length isBorderBox jQuery css elem boxSizing styles border box Where available offsetWidth offsetHeight approximate border box dimensions Where not available e g SVG assume unreliable box sizing and interpret the retrieved value a content box dimension valueIsBorderBox offsetProp elem valueIsBorderBox val elem offsetProp Normalize and auto val parseFloat val Adjust the element s box model val boxModelAdjustment elem dimension extra isBorderBox border content valueIsBorderBox styles Provide the current computed size to request scroll gutter calculation gh val px jQuery extend Add style property hooks overriding the behavior getting and setting a style property cssHooks opacity elem computed computed We should always a back opacity ret curCSS elem opacity ret ret Don t automatically add px to these possibly unitless properties cssNumber animationIterationCount columnCount fillOpacity flexGrow flexShrink fontWeight gridArea gridColumn gridColumnEnd gridColumnStart gridRow gridRowEnd gridRowStart lineHeight opacity order orphans widows zIndex zoom Add properties whose names you wish to fix before setting or getting the value cssProps Get and the style property on a DOM Node style elem name value extra Don t styles on text and comment nodes elem elem nodeType elem nodeType elem style Make sure that we re working the right name ret hooks origName camelCase name isCustomProp rcustomProp test name style elem style Make sure that we re working the right name We don t want to query the value it a CSS custom property since they are user defined isCustomProp name finalPropName origName Gets hook the prefixed version then unprefixed version hooks jQuery cssHooks name jQuery cssHooks origName Check we re setting a value value value Convert or to relative numbers ret rcssNum exec value ret value adjustCSS elem name ret Fixes bug Make sure that and NaN values aren t value value value If a was passed add the unit except certain CSS properties The isCustomProp check can be removed jQuery when we only auto append px to a few hardcoded values isCustomProp value ret ret jQuery cssNumber origName px background props affect original clone s values support clearCloneStyle value name indexOf background style name inherit If a hook was provided use that value otherwise just the specified value hooks hooks value hooks elem value extra isCustomProp style setProperty name value style name value If a hook was provided the non computed value there hooks hooks ret hooks elem extra ret Otherwise just the value the style style name css elem name extra styles val num hooks origName camelCase name isCustomProp rcustomProp test name Make sure that we re working the right name We don t want to modify the value it a CSS custom property since they are user defined isCustomProp name finalPropName origName Try prefixed name followed by the unprefixed name hooks jQuery cssHooks name jQuery cssHooks origName If a hook was provided the computed value there hooks hooks val hooks elem extra Otherwise a way to the computed value exists use that val val curCSS elem name styles Convert normal to computed value val normal name cssNormalTransform val cssNormalTransform name Make numeric forced or a qualifier was provided and val looks numeric extra extra num parseFloat val extra isFinite num num val val jQuery each height width _i dimension jQuery cssHooks dimension elem computed extra computed Certain elements can have dimension info we invisibly show them but it must have a current display style that would benefit rdisplayswap test jQuery css elem display Support Safari Table columns Safari have non zero offsetWidth zero getBoundingClientRect width unless display changed Support IE only Running getBoundingClientRect on a disconnected node IE throws an error elem getClientRects length elem getBoundingClientRect width swap elem cssShow getWidthOrHeight elem dimension extra getWidthOrHeight elem dimension extra elem value extra matches styles getStyles elem Only read styles position the test has a chance to fail to avoid forcing a reflow scrollboxSizeBuggy support scrollboxSize styles position absolute To avoid forcing a reflow only fetch boxSizing we need it gh boxSizingNeeded scrollboxSizeBuggy extra isBorderBox boxSizingNeeded jQuery css elem boxSizing styles border box subtract extra boxModelAdjustment elem dimension extra isBorderBox styles Account unreliable border box dimensions by comparing offset to computed and faking a content box to border and padding gh isBorderBox scrollboxSizeBuggy subtract Math ceil elem offset dimension toUpperCase dimension slice parseFloat styles dimension boxModelAdjustment elem dimension border styles Convert to pixels value adjustment needed subtract matches rcssNum exec value matches px px elem style dimension value value jQuery css elem dimension setPositiveNumber elem value subtract jQuery cssHooks marginLeft addGetHookIf support reliableMarginLeft elem computed computed parseFloat curCSS elem marginLeft elem getBoundingClientRect left swap elem marginLeft elem getBoundingClientRect left px These hooks are used by animate to expand properties jQuery each margin padding border Width prefix suffix jQuery cssHooks prefix suffix expand value i expanded Assumes a single not a parts value value split value i i expanded prefix cssExpand i suffix parts i parts i parts expanded prefix margin jQuery cssHooks prefix suffix setPositiveNumber jQuery fn extend css name value access elem name value styles len map i Array isArray name styles getStyles elem len name length i len i map name i jQuery css elem name i styles map value jQuery style elem name value jQuery css elem name name value arguments length Tween elem options prop end easing Tween prototype init elem options prop end easing jQuery Tween Tween Tween prototype Tween init elem options prop end easing unit elem elem prop prop easing easing jQuery easing _default options options start now cur end end unit unit jQuery cssNumber prop px cur hooks Tween propHooks prop hooks hooks hooks Tween propHooks _default run percent eased hooks Tween propHooks prop options duration pos eased jQuery easing easing percent options duration percent options duration pos eased percent now end start eased start options step options step call elem now hooks hooks hooks Tween propHooks _default Tween prototype init prototype Tween prototype Tween propHooks _default tween result Use a property on the element directly when it not a DOM element or when there no matching style property that exists tween elem nodeType tween elem tween prop tween elem style tween prop tween elem tween prop Passing an empty a rd parameter to css will automatically attempt a parseFloat and fallback to a the parse fails Simple values such px are parsed to Float complex values such rotate rad are returned result jQuery css tween elem tween prop Empty strings and auto are converted to result result auto result tween Use step hook back compat Use cssHook its there Use style available and use plain properties where available jQuery fx step tween prop jQuery fx step tween prop tween tween elem nodeType jQuery cssHooks tween prop tween elem style finalPropName tween prop jQuery style tween elem tween prop tween now tween unit tween elem tween prop tween now Support IE only Panic based approach to setting things on disconnected nodes Tween propHooks scrollTop Tween propHooks scrollLeft tween tween elem nodeType tween elem parentNode tween elem tween prop tween now jQuery easing linear p p swing p Math cos p Math PI _default swing jQuery fx Tween prototype init Back compat extension point jQuery fx step fxNow inProgress rfxtypes toggle show hide rrun queueHooks schedule inProgress document hidden window requestAnimationFrame window requestAnimationFrame schedule window setTimeout schedule jQuery fx interval jQuery fx tick Animations created synchronously will run synchronously createFxNow window setTimeout fxNow fxNow Date now Generate parameters to create a standard animation genFx includeWidth which i attrs height If we include width step value to all cssExpand values otherwise step value to skip over Left and Right includeWidth includeWidth i i includeWidth which cssExpand i attrs margin which attrs padding which includeWidth attrs opacity attrs width attrs createTween value prop animation tween collection Animation tweeners prop concat Animation tweeners index length collection length index length index tween collection index call animation prop value We re done property tween defaultPrefilter elem props opts prop value toggle hooks oldfire propTween restoreDisplay display isBox width props height props anim orig style elem style hidden elem nodeType isHiddenWithinTree elem dataShow dataPriv elem fxshow Queue skipping animations hijack the fx hooks opts queue hooks jQuery _queueHooks elem fx hooks unqueued hooks unqueued oldfire hooks empty fire hooks empty fire hooks unqueued oldfire hooks unqueued anim always Ensure the complete handler called before completes anim always hooks unqueued jQuery queue elem fx length hooks empty fire Detect show hide animations prop props value props prop rfxtypes test value props prop toggle toggle value toggle value hidden hide show Pretend to be hidden a show and there still data a stopped show hide value show dataShow dataShow prop hidden Ignore all other no op show hide data orig prop dataShow dataShow prop jQuery style elem prop Bail a no op like hide hide propTween jQuery isEmptyObject props propTween jQuery isEmptyObject orig Restrict overflow and display styles during box animations isBox elem nodeType Support IE Edge Record all overflow attributes because IE does not the shorthand identically valued overflowX and overflowY and Edge just mirrors the overflowX value there opts overflow style overflow style overflowX style overflowY Identify a display preferring old show hide data over the CSS cascade restoreDisplay dataShow dataShow display restoreDisplay restoreDisplay dataPriv elem display display jQuery css elem display display none restoreDisplay display restoreDisplay Get nonempty value s by temporarily forcing visibility showHide elem restoreDisplay elem style display restoreDisplay display jQuery css elem display showHide elem Animate inline elements inline block display inline display inline block restoreDisplay jQuery css elem float none Restore the original display value at the end pure show hide animations propTween anim done style display restoreDisplay restoreDisplay display style display restoreDisplay display none display style display inline block opts overflow style overflow hidden anim always style overflow opts overflow style overflowX opts overflow style overflowY opts overflow Implement show hide animations propTween prop orig General show hide setup element animation propTween dataShow hidden dataShow hidden dataShow hidden dataShow dataPriv access elem fxshow display restoreDisplay Store hidden visible toggle so stop toggle reverses toggle dataShow hidden hidden Show elements before animating them hidden showHide elem eslint disable no loop func anim done eslint enable no loop func The final step a hide animation actually hiding the element hidden showHide elem dataPriv remove elem fxshow prop orig jQuery style elem prop orig prop Per property setup propTween createTween hidden dataShow prop prop anim prop dataShow dataShow prop propTween start hidden propTween end propTween start propTween start propFilter props specialEasing index name easing value hooks camelCase specialEasing and expand cssHook pass index props name camelCase index easing specialEasing name value props index Array isArray value easing value value props index value index name props name value props index hooks jQuery cssHooks name hooks expand hooks value hooks expand value props name Not quite extend won t overwrite existing keys Reusing index because we have the correct name index value index props props index value index specialEasing index easing specialEasing name easing Animation elem properties options result stopped index length Animation prefilters length deferred jQuery Deferred always Don t match elem the animated selector tick elem tick stopped currentTime fxNow createFxNow remaining Math max animation startTime animation duration currentTime Support Android only Archaic crash bug won t allow us to use temp remaining animation duration percent temp index length animation tweens length index length index animation tweens index run percent deferred notifyWith elem animation percent remaining If there s more to percent length remaining If was an empty animation synthesize a final progress notification length deferred notifyWith elem animation Resolve the animation and report its conclusion deferred resolveWith elem animation animation deferred promise elem elem props jQuery extend properties opts jQuery extend specialEasing easing jQuery easing _default options originalProperties properties originalOptions options startTime fxNow createFxNow duration options duration tweens createTween prop end tween jQuery Tween elem animation opts prop end animation opts specialEasing prop animation opts easing animation tweens push tween tween stop gotoEnd index If we are going to the end we want to run all the tweens otherwise we skip part length gotoEnd animation tweens length stopped stopped index length index animation tweens index run Resolve when we played the last frame otherwise reject gotoEnd deferred notifyWith elem animation deferred resolveWith elem animation gotoEnd deferred rejectWith elem animation gotoEnd props animation props propFilter props animation opts specialEasing index length index result Animation prefilters index call animation elem props animation opts result isFunction result stop jQuery _queueHooks animation elem animation opts queue stop result stop bind result result jQuery map props createTween animation isFunction animation opts start animation opts start call elem animation Attach callbacks options animation progress animation opts progress done animation opts done animation opts complete fail animation opts fail always animation opts always jQuery fx timer jQuery extend tick elem elem anim animation queue animation opts queue animation jQuery Animation jQuery extend Animation tweeners prop value tween createTween prop value adjustCSS tween elem prop rcssNum exec value tween tween tweener props callback isFunction props callback props props props props match rnothtmlwhite prop index length props length index length index prop props index Animation tweeners prop Animation tweeners prop Animation tweeners prop unshift callback prefilters defaultPrefilter prefilter callback prepend prepend Animation prefilters unshift callback Animation prefilters push callback jQuery speed speed easing fn opt speed speed jQuery extend speed complete fn fn easing isFunction speed speed duration speed easing fn easing easing isFunction easing easing Go to the end state fx are off jQuery fx off opt duration opt duration opt duration jQuery fx speeds opt duration jQuery fx speeds opt duration opt duration jQuery fx speeds _default Normalize opt queue fx opt queue opt queue opt queue fx Queueing opt old opt complete opt complete isFunction opt old opt old call opt queue jQuery dequeue opt queue opt jQuery fn extend fadeTo speed to easing callback Show hidden elements after setting opacity to filter isHiddenWithinTree css opacity show Animate to the value specified end animate opacity to speed easing callback animate prop speed easing callback empty jQuery isEmptyObject prop optall jQuery speed speed easing callback doAnimation Operate on a copy prop so per property easing won t be lost anim Animation jQuery extend prop optall Empty animations or finishing resolves immediately empty dataPriv finish anim stop doAnimation finish doAnimation empty optall queue each doAnimation queue optall queue doAnimation stop clearQueue gotoEnd stopQueue hooks stop hooks stop hooks stop stop gotoEnd gotoEnd clearQueue clearQueue clearQueue queue fx each dequeue index queueHooks timers jQuery timers data dataPriv index data index data index stop stopQueue data index index data data index data index stop rrun test index stopQueue data index index timers length index timers index elem timers index queue timers index anim stop gotoEnd dequeue timers splice index Start the next the queue the last step wasn t forced Timers currently will call their complete callbacks which will dequeue but only they were gotoEnd dequeue gotoEnd jQuery dequeue finish fx each index data dataPriv queue data queue hooks data queueHooks timers jQuery timers length queue queue length Enable finishing flag on data data finish Empty the queue first jQuery queue hooks hooks stop hooks stop call Look active animations and finish them index timers length index timers index elem timers index queue timers index anim stop timers splice index Look animations the old queue and finish them index index length index queue index queue index finish queue index finish call Turn off finishing flag data finish jQuery each toggle show hide _i name cssFn jQuery fn name jQuery fn name speed easing callback speed speed cssFn apply arguments animate genFx name speed easing callback Generate shortcuts custom animations jQuery each slideDown genFx show slideUp genFx hide slideToggle genFx toggle fadeIn opacity show fadeOut opacity hide fadeToggle opacity toggle name props jQuery fn name speed easing callback animate props speed easing callback jQuery timers jQuery fx tick timer i timers jQuery timers fxNow Date now i timers length i timer timers i Run the timer and safely remove it when done allowing external removal timer timers i timer timers splice i timers length jQuery fx stop fxNow jQuery fx timer timer jQuery timers push timer jQuery fx start jQuery fx interval jQuery fx start inProgress inProgress schedule jQuery fx stop inProgress jQuery fx speeds slow fast Default speed _default Based off the plugin by Clint Helfers permission https web archive org web http blindsignals com index php jquery delay jQuery fn delay time time jQuery fx jQuery fx speeds time time time fx queue next hooks timeout window setTimeout next time hooks stop window clearTimeout timeout input document createElement input select document createElement select opt select appendChild document createElement option input checkbox Support Android only Default value a checkbox should be on support checkOn input value Support IE only Must access selectedIndex to make options select support optSelected opt selected Support IE only An input loses its value after becoming a radio input document createElement input input value t input radio support radioValue input value t boolHook attrHandle jQuery expr attrHandle jQuery fn extend attr name value access jQuery attr name value arguments length removeAttr name each jQuery removeAttr name jQuery extend attr elem name value ret hooks nType elem nodeType Don t attributes on text comment and attribute nodes nType nType nType Fallback to prop when attributes are not supported elem getAttribute jQuery prop elem name value Attribute hooks are determined by the lowercase version Grab necessary hook one defined nType jQuery isXMLDoc elem hooks jQuery attrHooks name toLowerCase jQuery expr match bool test name boolHook value value jQuery removeAttr elem name hooks hooks ret hooks elem value name ret elem setAttribute name value value hooks hooks ret hooks elem name ret ret jQuery find attr elem name Non existent attributes we normalize to ret ret attrHooks elem value support radioValue value radio nodeName elem input val elem value elem setAttribute value val elem value val value removeAttr elem value name i Attribute names can contain non HTML whitespace characters https html spec whatwg org multipage syntax html attributes attrNames value value match rnothtmlwhite attrNames elem nodeType name attrNames i elem removeAttribute name Hooks attributes boolHook elem value name value Remove attributes when to jQuery removeAttr elem name elem setAttribute name name name jQuery each jQuery expr match bool source match w g _i name getter attrHandle name jQuery find attr attrHandle name elem name isXML ret handle lowercaseName name toLowerCase isXML Avoid an infinite loop by temporarily removing the getter handle attrHandle lowercaseName attrHandle lowercaseName ret ret getter elem name isXML lowercaseName attrHandle lowercaseName handle ret rfocusable input select textarea button i rclickable a area i jQuery fn extend prop name value access jQuery prop name value arguments length removeProp name each jQuery propFix name name jQuery extend prop elem name value ret hooks nType elem nodeType Don t properties on text comment and attribute nodes nType nType nType nType jQuery isXMLDoc elem Fix name and attach hooks name jQuery propFix name name hooks jQuery propHooks name value hooks hooks ret hooks elem value name ret elem name value hooks hooks ret hooks elem name ret elem name propHooks tabIndex elem Support IE only elem tabIndex doesn t always the correct value when it hasn t been explicitly https web archive org web http fluidproject org blog getting setting and removing tabindex values javascript Use proper attribute retrieval tabindex jQuery find attr elem tabindex tabindex parseInt tabindex rfocusable test elem nodeName rclickable test elem nodeName elem href propFix htmlFor className Support IE only Accessing the selectedIndex property forces the browser to respect setting selected on the option The getter ensures a option selected when an optgroup eslint rule no unused expressions disabled code since it considers such accessions noop support optSelected jQuery propHooks selected elem eslint no unused expressions off parent elem parentNode parent parent parentNode parent parentNode selectedIndex elem eslint no unused expressions off parent elem parentNode parent parent selectedIndex parent parentNode parent parentNode selectedIndex jQuery each tabIndex readOnly maxLength cellSpacing cellPadding rowSpan colSpan useMap frameBorder contentEditable jQuery propFix toLowerCase Strip and collapse whitespace according to HTML spec https infra spec whatwg org strip and collapse ascii whitespace stripAndCollapse value tokens value match rnothtmlwhite tokens join getClass elem elem getAttribute elem getAttribute classesToArray value Array isArray value value value value match rnothtmlwhite jQuery fn extend addClass value classes elem cur curValue clazz j finalValue i isFunction value each j jQuery addClass value call j getClass classes classesToArray value classes length elem i curValue getClass elem cur elem nodeType stripAndCollapse curValue cur j clazz classes j cur indexOf clazz cur clazz Only assign different to avoid unneeded rendering finalValue stripAndCollapse cur curValue finalValue elem setAttribute finalValue removeClass value classes elem cur curValue clazz j finalValue i isFunction value each j jQuery removeClass value call j getClass arguments length attr classes classesToArray value classes length elem i curValue getClass elem This expression here better compressibility see addClass cur elem nodeType stripAndCollapse curValue cur j clazz classes j Remove all instances cur indexOf clazz cur cur replace clazz Only assign different to avoid unneeded rendering finalValue stripAndCollapse cur curValue finalValue elem setAttribute finalValue toggleClass value stateVal value isValidValue Array isArray value stateVal isValidValue stateVal addClass value removeClass value isFunction value each i jQuery toggleClass value call i getClass stateVal stateVal each className i self classNames isValidValue Toggle individual names i self jQuery classNames classesToArray value className classNames i Check each className given space separated list self hasClass className self removeClass className self addClass className Toggle whole name value className getClass className Store className dataPriv __className__ className If the element has a name or we re passed then remove the whole classname there was one the above saved it Otherwise bring back whatever was previously saved anything falling back to the empty nothing was stored setAttribute setAttribute className value dataPriv __className__ hasClass selector className elem i className selector elem i elem nodeType stripAndCollapse getClass elem indexOf className rreturn r g jQuery fn extend val value hooks ret valueIsFunction elem arguments length elem hooks jQuery valHooks elem jQuery valHooks elem nodeName toLowerCase hooks hooks ret hooks elem value ret ret elem value Handle most common cases ret ret replace rreturn Handle cases where value undef or ret ret valueIsFunction isFunction value each i val nodeType valueIsFunction val value call i jQuery val val value Treat convert numbers to val val val val Array isArray val val jQuery map val value value value hooks jQuery valHooks jQuery valHooks nodeName toLowerCase If returns fall back to normal setting hooks hooks hooks val value value val jQuery extend valHooks option elem val jQuery find attr elem value val val Support IE only option text throws exceptions Strip and collapse whitespace https html spec whatwg org strip and collapse whitespace stripAndCollapse jQuery text elem select elem value option i options elem options index elem selectedIndex one elem select one values one max one index options length index i max i one index Loop through all the selected options i max i option options i Support IE only IE8 doesn t update selected after form reset option selected i index Don t options that are disabled or a disabled optgroup option disabled option parentNode disabled nodeName option parentNode optgroup Get the specific value the option value jQuery option val We don t need an array one selects one value Multi Selects an array values push value values elem value optionSet option options elem options values jQuery makeArray value i options length i option options i eslint disable no cond assign option selected jQuery inArray jQuery valHooks option option values optionSet eslint enable no cond assign Force browsers to behave consistently when non matching value optionSet elem selectedIndex values Radios and checkboxes getter setter jQuery each radio checkbox jQuery valHooks elem value Array isArray value elem checked jQuery inArray jQuery elem val value support checkOn jQuery valHooks elem elem getAttribute value on elem value Return jQuery attributes only inclusion support focusin onfocusin window rfocusMorph focusinfocus focusoutblur stopPropagationCallback e e stopPropagation jQuery extend jQuery event trigger event data elem onlyHandlers i cur tmp bubbleType ontype handle special lastElement eventPath elem document hasOwn call event event event namespaces hasOwn call event event split cur lastElement tmp elem elem document Don t events on text and comment nodes elem nodeType elem nodeType focus blur morphs to focusin ensure we re not firing them right now rfocusMorph test jQuery event triggered indexOf Namespaced trigger create a regexp to match event handle namespaces split namespaces shift namespaces sort ontype indexOf on Caller can pass a jQuery Event Object or just an event event event jQuery expando event jQuery Event event event Trigger bitmask native handlers jQuery always event isTrigger onlyHandlers event namespaces join event rnamespace event RegExp namespaces join Clean up the event it being reused event result event target event target elem Clone incoming data and prepend the event creating the handler arg list data data event jQuery makeArray data event Allow special events to draw outside the lines special jQuery event special onlyHandlers special trigger special trigger apply elem data Determine event propagation path advance per W3C events spec Bubble up to document then to window watch a ownerDocument onlyHandlers special noBubble isWindow elem bubbleType special delegateType rfocusMorph test bubbleType cur cur parentNode cur cur cur parentNode eventPath push cur tmp cur Only add window we got to document e g not plain obj or detached DOM tmp elem ownerDocument document eventPath push tmp defaultView tmp parentWindow window Fire handlers on the event path i cur eventPath i event isPropagationStopped lastElement cur event i bubbleType special bindType jQuery handler handle dataPriv cur events Object create event dataPriv cur handle handle handle apply cur data Native handler handle ontype cur ontype handle handle apply acceptData cur event result handle apply cur data event result event preventDefault event If nobody prevented the action it now onlyHandlers event isDefaultPrevented special _default special _default apply eventPath pop data acceptData elem Call a native DOM method on the target the same name the event Don t actions on window that s where variables be ontype isFunction elem isWindow elem Don t re trigger an onFOO event when we call its FOO method tmp elem ontype tmp elem ontype Prevent re triggering the same event since we already bubbled it above jQuery event triggered event isPropagationStopped lastElement addEventListener stopPropagationCallback elem event isPropagationStopped lastElement removeEventListener stopPropagationCallback jQuery event triggered tmp elem ontype tmp event result Piggyback on a donor event to simulate a different one Used only focus events simulate elem event e jQuery extend jQuery Event event isSimulated jQuery event trigger e elem jQuery fn extend trigger data each jQuery event trigger data triggerHandler data elem elem jQuery event trigger data elem Support Firefox Firefox doesn t have focus events Related ticket https bugzilla mozilla org show_bug cgi id Support Chrome Safari focus events fire after focus blur events which spec violation http www w3 org TR DOM Level Events events focusevent event order Related ticket https bugs chromium org p chromium issues detail id support focusin jQuery each focus focusin blur focusout orig fix Attach a single capturing handler on the document someone wants focusin focusout handler event jQuery event simulate fix event target jQuery event fix event jQuery event special fix setup Handle regular nodes via ownerDocument window via document document via doc ownerDocument document attaches dataPriv access doc fix attaches doc addEventListener orig handler dataPriv access doc fix attaches teardown doc ownerDocument document attaches dataPriv access doc fix attaches doc removeEventListener orig handler dataPriv remove doc fix dataPriv access doc fix attaches location window location nonce guid Date now rquery Cross browser xml parsing jQuery parseXML data xml data data Support IE only IE throws on parseFromString invalid input xml window DOMParser parseFromString data text xml e xml xml xml getElementsByTagName parsererror length jQuery error Invalid XML data xml rbracket rCRLF r n g rsubmitterTypes submit button image reset file i rsubmittable input select textarea keygen i buildParams prefix obj traditional add name Array isArray obj Serialize array item jQuery each obj i v traditional rbracket test prefix Treat each array item a scalar add prefix v Item non scalar array or encode its numeric index buildParams prefix v v i v traditional add traditional toType obj Serialize item name obj buildParams prefix name obj name traditional add Serialize scalar item add prefix obj Serialize an array form elements or a key values into a query jQuery param a traditional prefix s add key valueOrFunction If value a invoke it and use its value value isFunction valueOrFunction valueOrFunction valueOrFunction s s length encodeURIComponent key encodeURIComponent value value a If an array was passed assume that it an array form elements Array isArray a a jquery jQuery isPlainObject a Serialize the form elements jQuery each a add name value If traditional encode the old way the way or older did it otherwise encode params recursively prefix a buildParams prefix a prefix traditional add Return the resulting serialization s join jQuery fn extend serialize jQuery param serializeArray serializeArray map Can add propHook elements to filter or add form elements elements jQuery prop elements elements jQuery makeArray elements filter Use disabled so that fieldset disabled works name jQuery disabled rsubmittable test nodeName rsubmitterTypes test checked rcheckableType test map _i elem val jQuery val val Array isArray val jQuery map val val name elem name value val replace rCRLF r n name elem name value val replace rCRLF r n r20 g rhash rantiCache _ rheaders t r n mg local protocol detection rlocalProtocol about app app storage extension file res widget rnoContent GET HEAD rprotocol Prefilters They are useful to introduce custom dataTypes see ajax jsonp js an example These are called BEFORE asking a transport AFTER param serialization s data a s processData key the dataType the catchall can be used execution will start transport dataType and THEN down to needed prefilters Transports bindings key the dataType the catchall can be used selection will start transport dataType and THEN go to needed transports Avoid comment prolog char sequence must appease lint and evade compression allTypes concat Anchor tag parsing the document origin originAnchor document createElement a originAnchor href location href Base jQuery ajaxPrefilter and jQuery ajaxTransport addToPrefiltersOrTransports structure dataTypeExpression optional and defaults to dataTypeExpression func dataTypeExpression func dataTypeExpression dataTypeExpression dataType i dataTypes dataTypeExpression toLowerCase match rnothtmlwhite isFunction func For each dataType the dataTypeExpression dataType dataTypes i Prepend requested dataType dataType dataType slice structure dataType structure dataType unshift func Otherwise append structure dataType structure dataType push func Base inspection prefilters and transports inspectPrefiltersOrTransports structure options originalOptions jqXHR inspected seekingTransport structure transports inspect dataType selected inspected dataType jQuery each structure dataType _ prefilterOrFactory dataTypeOrTransport prefilterOrFactory options originalOptions jqXHR dataTypeOrTransport seekingTransport inspected dataTypeOrTransport options dataTypes unshift dataTypeOrTransport inspect dataTypeOrTransport seekingTransport selected dataTypeOrTransport selected inspect options dataTypes inspected inspect A special extend ajax options that takes flat options not to be deep extended Fixes ajaxExtend target src key deep flatOptions jQuery ajaxSettings flatOptions key src src key flatOptions key target deep deep key src key deep jQuery extend target deep target Handles responses to an ajax request finds the right dataType mediates between content and expected dataType returns the corresponding response ajaxHandleResponses s jqXHR responses ct finalDataType firstDataType contents s contents dataTypes s dataTypes Remove auto dataType and content the process dataTypes dataTypes shift ct ct s mimeType jqXHR getResponseHeader Content Type Check we re dealing a known content ct contents contents contents test ct dataTypes unshift Check to see we have a response the expected dataType dataTypes responses finalDataType dataTypes Try convertible dataTypes responses dataTypes s converters dataTypes finalDataType firstDataType firstDataType Or just use first one finalDataType finalDataType firstDataType If we found a dataType We add the dataType to the list needed and the corresponding response finalDataType finalDataType dataTypes dataTypes unshift finalDataType responses finalDataType Chain conversions given the request and the original response Also sets the responseXXX fields on the jqXHR instance ajaxConvert s response jqXHR isSuccess conv2 current conv tmp prev converters Work a copy dataTypes we need to modify it conversion dataTypes s dataTypes slice Create converters map lowercased keys dataTypes conv s converters converters conv toLowerCase s converters conv current dataTypes shift Convert to each sequential dataType current s responseFields current jqXHR s responseFields current response Apply the dataFilter provided prev isSuccess s dataFilter response s dataFilter response s dataType prev current current dataTypes shift current There s only work to current dataType non auto current current prev Convert response prev dataType non auto and differs current prev prev current Seek a direct converter conv converters prev current converters current If none found seek a pair conv conv2 converters If conv2 outputs current tmp conv2 split tmp current If prev can be converted to accepted input conv converters prev tmp converters tmp conv Condense equivalence converters conv conv converters conv2 Otherwise insert the intermediate dataType converters conv2 current tmp dataTypes unshift tmp Apply converter not an equivalence conv Unless errors are allowed to bubble and them conv s throws response conv response response conv response e state parsererror error conv e No conversion prev to current state success data response jQuery extend Counter holding the active queries active Last Modified header cache next request lastModified etag ajaxSettings url location href GET isLocal rlocalProtocol test location protocol processData contentType application x www form urlencoded charset UTF timeout data dataType username password cache throws traditional headers accepts allTypes text text plain html text html xml application xml text xml json application json text javascript contents xml bxml b html bhtml json bjson b responseFields xml responseXML text responseText json responseJSON Data converters Keys separate source or catchall and destination types a single space converters Convert anything to text text String Text to html no transformation text html Evaluate text a json expression text json JSON parse Parse text xml text xml jQuery parseXML For options that shouldn t be deep extended you can add your own custom options here and when you create one that shouldn t be deep extended see ajaxExtend flatOptions url context Creates a full fledged settings into target both ajaxSettings and settings fields If target omitted writes into ajaxSettings ajaxSetup target settings settings Building a settings ajaxExtend ajaxExtend target jQuery ajaxSettings settings Extending ajaxSettings ajaxExtend jQuery ajaxSettings target ajaxPrefilter addToPrefiltersOrTransports prefilters ajaxTransport addToPrefiltersOrTransports transports Main method ajax url options If url an simulate pre signature url options url url Force options to be an options options transport URL without anti cache param cacheURL Response headers responseHeadersString responseHeaders timeout handle timeoutTimer Url cleanup urlAnchor Request state becomes upon send and upon completion completed To know events are to be dispatched fireGlobals Loop variable i uncached part the url uncached Create the final options s jQuery ajaxSetup options Callbacks context callbackContext s context s Context events callbackContext it a DOM node or jQuery collection globalEventContext s context callbackContext nodeType callbackContext jquery jQuery callbackContext jQuery event Deferreds deferred jQuery Deferred completeDeferred jQuery Callbacks once memory Status dependent callbacks statusCode s statusCode Headers they are sent all at once requestHeaders requestHeadersNames Default abort message strAbort canceled Fake xhr jqXHR readyState Builds headers hashtable needed getResponseHeader key match completed responseHeaders responseHeaders match rheaders exec responseHeadersString responseHeaders match toLowerCase responseHeaders match toLowerCase concat match match responseHeaders key toLowerCase match match join Raw getAllResponseHeaders completed responseHeadersString Caches the header setRequestHeader name value completed name requestHeadersNames name toLowerCase requestHeadersNames name toLowerCase name requestHeaders name value Overrides response content header overrideMimeType completed s mimeType Status dependent callbacks statusCode map code map completed Execute the appropriate callbacks jqXHR always map jqXHR status Lazy add the callbacks a way that preserves old ones code map statusCode code statusCode code map code Cancel the request abort statusText finalText statusText strAbort transport transport abort finalText done finalText Attach deferreds deferred promise jqXHR Add protocol not provided prefilters might expect it Handle falsy url the settings consistency old signature We also use the url parameter available s url url s url location href replace rprotocol location protocol Alias method option to per ticket s options method options s method s Extract dataTypes list s dataTypes s dataType toLowerCase match rnothtmlwhite A cross domain request order when the origin doesn t match the current origin s crossDomain urlAnchor document createElement a Support IE Edge IE throws exception on accessing the href property url malformed e g http example com x urlAnchor href s url Support IE only Anchor s host property isn t correctly when s url relative urlAnchor href urlAnchor href s crossDomain originAnchor protocol originAnchor host urlAnchor protocol urlAnchor host e If there an error parsing the URL assume it crossDomain it can be rejected by the transport it invalid s crossDomain Convert data not already a s data s processData s data s data jQuery param s data s traditional Apply prefilters inspectPrefiltersOrTransports prefilters s options jqXHR If request was aborted inside a prefilter stop there completed jqXHR We can fire events now asked to Don t fire events jQuery event an AMD usage scenario fireGlobals jQuery event s Watch a requests fireGlobals jQuery active jQuery event trigger ajaxStart Uppercase the s s toUpperCase Determine request has content s hasContent rnoContent test s Save the URL we re toying the If Modified Since and or If None Match header later on Remove hash to simplify url manipulation cacheURL s url replace rhash More options handling requests no content s hasContent Remember the hash so we can put it back uncached s url slice cacheURL length If data available and should be processed append data to url s data s processData s data cacheURL rquery test cacheURL s data remove data so that it s not used an eventual retry s data Add or update anti cache param needed s cache cacheURL cacheURL replace rantiCache uncached rquery test cacheURL _ nonce guid uncached Put hash and anti cache on the URL that will be requested gh s url cacheURL uncached Change to encoded form body content gh s data s processData s contentType indexOf application x www form urlencoded s data s data replace r20 Set the If Modified Since and or If None Match header ifModified mode s ifModified jQuery lastModified cacheURL jqXHR setRequestHeader If Modified Since jQuery lastModified cacheURL jQuery etag cacheURL jqXHR setRequestHeader If None Match jQuery etag cacheURL Set the correct header data being sent s data s hasContent s contentType options contentType jqXHR setRequestHeader Content Type s contentType Set the Accepts header the server depending on the dataType jqXHR setRequestHeader Accept s dataTypes s accepts s dataTypes s accepts s dataTypes s dataTypes allTypes q s accepts Check headers option i s headers jqXHR setRequestHeader i s headers i Allow custom headers mimetypes and early abort s beforeSend s beforeSend call callbackContext jqXHR s completed Abort not done already and jqXHR abort Aborting no longer a cancellation strAbort abort Install callbacks on deferreds completeDeferred add s complete jqXHR done s success jqXHR fail s error Get transport transport inspectPrefiltersOrTransports transports s options jqXHR If no transport we auto abort transport done No Transport jqXHR readyState Send event fireGlobals globalEventContext trigger ajaxSend jqXHR s If request was aborted inside ajaxSend stop there completed jqXHR Timeout s s timeout timeoutTimer window setTimeout jqXHR abort timeout s timeout completed transport send requestHeaders done e Rethrow post completion exceptions completed e Propagate others results done e Callback when everything done done status nativeStatusText responses headers isSuccess success error response modified statusText nativeStatusText Ignore repeat invocations completed completed Clear timeout it exists timeoutTimer window clearTimeout timeoutTimer Dereference transport early garbage collection no matter how long the jqXHR will be used transport Cache response headers responseHeadersString headers Set readyState jqXHR readyState status Determine successful isSuccess status status status Get response data responses response ajaxHandleResponses s jqXHR responses Use a noop converter missing script isSuccess jQuery inArray script s dataTypes s converters text script Convert no matter what that way responseXXX fields are always response ajaxConvert s response jqXHR isSuccess If successful handle chaining isSuccess Set the If Modified Since and or If None Match header ifModified mode s ifModified modified jqXHR getResponseHeader Last Modified modified jQuery lastModified cacheURL modified modified jqXHR getResponseHeader etag modified jQuery etag cacheURL modified no content status s HEAD statusText nocontent not modified status statusText notmodified If we have data s convert it statusText response state success response data error response error isSuccess error Extract error statusText and normalize non aborts error statusText status statusText statusText error status status Set data the fake xhr jqXHR status status jqXHR statusText nativeStatusText statusText Success Error isSuccess deferred resolveWith callbackContext success statusText jqXHR deferred rejectWith callbackContext jqXHR statusText error Status dependent callbacks jqXHR statusCode statusCode statusCode fireGlobals globalEventContext trigger isSuccess ajaxSuccess ajaxError jqXHR s isSuccess success error Complete completeDeferred fireWith callbackContext jqXHR statusText fireGlobals globalEventContext trigger ajaxComplete jqXHR s Handle the AJAX counter jQuery active jQuery event trigger ajaxStop jqXHR getJSON url data callback jQuery url data callback json getScript url callback jQuery url callback script jQuery each post _i method jQuery method url data callback Shift arguments data argument was omitted isFunction data callback callback data data The url can be an options which then must have url jQuery ajax jQuery extend url url method dataType data data success callback jQuery isPlainObject url url jQuery ajaxPrefilter s i i s headers i toLowerCase content s contentType s headers i jQuery _evalUrl url options doc jQuery ajax url url Make explicit since user can through ajaxSetup GET dataType script cache Only evaluate the response it successful gh dataFilter not invoked failure responses so using it instead the converter kludgy but it works converters text script dataFilter response jQuery globalEval response options doc jQuery fn extend wrapAll html wrap isFunction html html html call The elements to wrap the target around wrap jQuery html ownerDocument eq clone parentNode wrap insertBefore wrap map elem elem firstElementChild elem elem firstElementChild elem append wrapInner html isFunction html each i jQuery wrapInner html call i each self jQuery contents self contents contents length contents wrapAll html self append html wrap html htmlIsFunction isFunction html each i jQuery wrapAll htmlIsFunction html call i html unwrap selector parent selector not body each jQuery replaceWith childNodes jQuery expr pseudos hidden elem jQuery expr pseudos visible elem jQuery expr pseudos visible elem elem offsetWidth elem offsetHeight elem getClientRects length jQuery ajaxSettings xhr window XMLHttpRequest e xhrSuccessStatus File protocol always yields status code assume Support IE only sometimes IE returns when it should be xhrSupported jQuery ajaxSettings xhr support cors xhrSupported withCredentials xhrSupported support ajax xhrSupported xhrSupported jQuery ajaxTransport options callback errorCallback Cross domain only allowed supported through XMLHttpRequest support cors xhrSupported options crossDomain send headers complete i xhr options xhr xhr open options options url options options username options password Apply custom fields provided options xhrFields i options xhrFields xhr i options xhrFields i Override mime needed options mimeType xhr overrideMimeType xhr overrideMimeType options mimeType X Requested With header For cross domain requests seeing conditions a preflight are akin to a jigsaw puzzle we simply it to be sure it can always be on a per request basis or even using ajaxSetup For same domain requests won t change header already provided options crossDomain headers X Requested With headers X Requested With XMLHttpRequest Set headers i headers xhr setRequestHeader i headers i Callback callback callback callback errorCallback xhr onload xhr onerror xhr onabort xhr ontimeout xhr onreadystatechange abort xhr abort error Support IE only On a manual native abort IE9 throws errors on property access that not readyState xhr status complete error complete File protocol always yields status see xhr status xhr statusText complete xhrSuccessStatus xhr status xhr status xhr statusText Support IE only IE9 has no XHR2 but throws on binary trac For XHR2 non text the caller handle it gh xhr responseType text text xhr responseText binary xhr response text xhr responseText xhr getAllResponseHeaders Listen to events xhr onload callback errorCallback xhr onerror xhr ontimeout callback error Support IE only Use onreadystatechange to replace onabort to handle uncaught aborts xhr onabort xhr onabort errorCallback xhr onreadystatechange Check readyState before timeout it changes xhr readyState Allow onerror to be called first but that will not handle a native abort Also save errorCallback to a variable xhr onerror cannot be accessed window setTimeout callback errorCallback Create the abort callback callback callback abort Do send the request may raise an exception xhr send options hasContent options data e Only rethrow hasn t been notified an error yet callback e abort callback callback Prevent auto execution scripts when no explicit dataType was provided See gh jQuery ajaxPrefilter s s crossDomain s contents script Install script dataType jQuery ajaxSetup accepts script text javascript application javascript application ecmascript application x ecmascript contents script b java ecma script b converters text script text jQuery globalEval text text Handle cache s special and crossDomain jQuery ajaxPrefilter script s s cache s cache s crossDomain s GET Bind script tag hack transport jQuery ajaxTransport script s This transport only deals cross domain or forced by attrs requests s crossDomain s scriptAttrs script callback send _ complete script jQuery script attr s scriptAttrs prop charset s scriptCharset src s url on load error callback evt script remove callback evt complete evt error evt Use native DOM manipulation to avoid our domManip AJAX trickery document head appendChild script abort callback callback oldCallbacks rjsonp Default jsonp settings jQuery ajaxSetup jsonp callback jsonpCallback callback oldCallbacks pop jQuery expando _ nonce guid callback callback Detect normalize options and install callbacks jsonp requests jQuery ajaxPrefilter json jsonp s originalSettings jqXHR callbackName overwritten responseContainer jsonProp s jsonp rjsonp test s url url s data s contentType indexOf application x www form urlencoded rjsonp test s data data Handle iff the expected data jsonp or we have a parameter to jsonProp s dataTypes jsonp Get callback name remembering preexisting value associated it callbackName s jsonpCallback isFunction s jsonpCallback s jsonpCallback s jsonpCallback Insert callback into url or form data jsonProp s jsonProp s jsonProp replace rjsonp callbackName s jsonp s url rquery test s url s jsonp callbackName Use data converter to retrieve json after script execution s converters script json responseContainer jQuery error callbackName was not called responseContainer Force json dataType s dataTypes json Install callback overwritten window callbackName window callbackName responseContainer arguments Clean up fires after converters jqXHR always If previous value didn t exist remove it overwritten jQuery window removeProp callbackName Otherwise restore preexisting value window callbackName overwritten Save back free s callbackName Make sure that re using the options doesn t screw things around s jsonpCallback originalSettings jsonpCallback Save the callback name future use oldCallbacks push callbackName Call it was a and we have a response responseContainer isFunction overwritten overwritten responseContainer responseContainer overwritten Delegate to script script Support Safari only In Safari documents created via document implementation createHTMLDocument collapse sibling forms the second one becomes a child the first one Because that security measure has to be disabled Safari https bugs webkit org show_bug cgi id support createHTMLDocument body document implementation createHTMLDocument body body innerHTML form form form form body childNodes length Argument data should be html context optional If specified the fragment will be created context defaults to document keepScripts optional If will include scripts passed the html jQuery parseHTML data context keepScripts data context keepScripts context context base parsed scripts context Stop scripts or inline event handlers being executed immediately by using document implementation support createHTMLDocument context document implementation createHTMLDocument Set the base href the created document so parsed elements URLs are based on the document s URL gh base context createElement base base href document location href context head appendChild base context document parsed rsingleTag exec data scripts keepScripts Single tag parsed context createElement parsed parsed buildFragment data context scripts scripts scripts length jQuery scripts remove jQuery merge parsed childNodes Load a url into a page jQuery fn load url params callback selector response self off url indexOf off selector stripAndCollapse url slice off url url slice off If it s a isFunction params We assume that it s the callback callback params params Otherwise build a param params params POST If we have elements to modify make the request self length jQuery ajax url url If variable then GET method will be used Make value field explicit since user can it through ajaxSetup method GET dataType html data params done responseText Save response use complete callback response arguments self html selector If a selector was specified locate the right elements a dummy div Exclude scripts to avoid IE Permission Denied errors jQuery div append jQuery parseHTML responseText find selector Otherwise use the full result responseText If the request succeeds gets data status jqXHR but they are ignored because response was above If it fails gets jqXHR status error always callback jqXHR status self each callback apply response jqXHR responseText status jqXHR jQuery expr pseudos animated elem jQuery grep jQuery timers fn elem fn elem length jQuery offset setOffset elem options i curPosition curLeft curCSSTop curTop curOffset curCSSLeft calculatePosition position jQuery css elem position curElem jQuery elem props Set position first top left are even on elem position elem style position relative curOffset curElem offset curCSSTop jQuery css elem top curCSSLeft jQuery css elem left calculatePosition position absolute position fixed curCSSTop curCSSLeft indexOf auto Need to be able to calculate position either top or left auto and position either absolute or fixed calculatePosition curPosition curElem position curTop curPosition top curLeft curPosition left curTop parseFloat curCSSTop curLeft parseFloat curCSSLeft isFunction options Use jQuery extend here to allow modification coordinates argument gh options options call elem i jQuery extend curOffset options top props top options top curOffset top curTop options left props left options left curOffset left curLeft using options options using call elem props props top props top px props left props left px curElem css props jQuery fn extend offset relates an element s border box to the document origin offset options Preserve chaining setter arguments length options each i jQuery offset setOffset options i rect win elem elem Return zeros disconnected and hidden display none elements gh Support IE only Running getBoundingClientRect on a disconnected node IE throws an error elem getClientRects length top left Get document relative position by adding viewport scroll to viewport relative gBCR rect elem getBoundingClientRect win elem ownerDocument defaultView top rect top win pageYOffset left rect left win pageXOffset position relates an element s margin box to its offset parent s padding box This corresponds to the behavior CSS absolute positioning position offsetParent offset doc elem parentOffset top left position fixed elements are offset the viewport which itself always has zero offset jQuery css elem position fixed Assume position fixed implies availability getBoundingClientRect offset elem getBoundingClientRect offset offset Account the real offset parent which can be the document or its root element when a statically positioned element identified doc elem ownerDocument offsetParent elem offsetParent doc documentElement offsetParent offsetParent doc body offsetParent doc documentElement jQuery css offsetParent position offsetParent offsetParent parentNode offsetParent offsetParent elem offsetParent nodeType Incorporate borders into its offset since they are outside its content origin parentOffset jQuery offsetParent offset parentOffset top jQuery css offsetParent borderTopWidth parentOffset left jQuery css offsetParent borderLeftWidth Subtract parent offsets and element margins top offset top parentOffset top jQuery css elem marginTop left offset left parentOffset left jQuery css elem marginLeft This method will documentElement the following cases For the element inside the iframe without offsetParent method will documentElement the parent window For the hidden or detached element For body or html element i e the html node it will itself but those exceptions were presented a real life use cases and might be considered more preferable results This logic however not guaranteed and can change at point the future offsetParent map offsetParent offsetParent offsetParent jQuery css offsetParent position offsetParent offsetParent offsetParent offsetParent documentElement Create scrollLeft and scrollTop methods jQuery each scrollLeft pageXOffset scrollTop pageYOffset method prop top pageYOffset prop jQuery fn method val access elem method val Coalesce documents and windows win isWindow elem win elem elem nodeType win elem defaultView val win win prop elem method win win scrollTo top val win pageXOffset top val win pageYOffset elem method val method val arguments length Support Safari Chrome Add the top left cssHooks using jQuery fn position Webkit bug https bugs webkit org show_bug cgi id Blink bug https bugs chromium org p chromium issues detail id getComputedStyle returns percent when specified top left bottom right rather than make the css depend on the offset just check it here jQuery each top left _i prop jQuery cssHooks prop addGetHookIf support pixelPosition elem computed computed computed curCSS elem prop If curCSS returns percentage fallback to offset rnumnonpx test computed jQuery elem position prop px computed Create innerHeight innerWidth height width outerHeight and outerWidth methods jQuery each Height height Width width name jQuery each padding inner name content outer name defaultExtra funcName Margin only outerHeight outerWidth jQuery fn funcName margin value chainable arguments length defaultExtra margin extra defaultExtra margin value margin border access elem value doc isWindow elem window outerWidth Height w h including scrollbars gh funcName indexOf outer elem inner name elem document documentElement client name Get document width or height elem nodeType doc elem documentElement Either scroll Width Height or offset Width Height or client Width Height whichever greatest Math max elem body scroll name doc scroll name elem body offset name doc offset name doc client name value Get width or height on the element requesting but not forcing parseFloat jQuery css elem extra Set width or height on the element jQuery style elem value extra chainable margin chainable jQuery each ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend _i jQuery fn fn on fn jQuery fn extend bind types data fn on types data fn unbind types fn off types fn delegate selector types data fn on types selector data fn undelegate selector types fn or selector types fn arguments length off selector off types selector fn hover fnOver fnOut mouseenter fnOver mouseleave fnOut fnOver jQuery each blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu split _i name Handle event binding jQuery fn name data fn arguments length on name data fn trigger name Support Android only Make sure we trim BOM and NBSP rtrim s uFEFF xA0 s uFEFF xA0 g Bind a to a context optionally partially applying arguments jQuery proxy deprecated to promote standards specifically Function bind However it not slated removal time soon jQuery proxy fn context tmp args proxy context tmp fn context context fn fn tmp Quick check to determine target callable the spec throws a TypeError but we will just isFunction fn Simulated bind args slice call arguments proxy fn apply context args concat slice call arguments Set the guid handler to the same original handler so it can be removed proxy guid fn guid fn guid jQuery guid proxy jQuery holdReady hold hold jQuery readyWait jQuery ready jQuery isArray Array isArray jQuery parseJSON JSON parse jQuery nodeName nodeName jQuery isFunction isFunction jQuery isWindow isWindow jQuery camelCase camelCase jQuery toType jQuery now Date now jQuery isNumeric obj As jQuery isNumeric limited to strings and numbers primitives or objects that can be coerced to finite numbers gh jQuery obj parseFloat NaNs numeric cast positives but misinterprets leading strings particularly hex literals x subtraction forces infinities to NaN isNaN obj parseFloat obj jQuery trim text text text replace rtrim Register a named AMD since jQuery can be concatenated other files that may use define but not via a proper concatenation script that understands anonymous AMD modules A named AMD safest and most robust way to register Lowercase jquery used because AMD names are derived file names and jQuery normally delivered a lowercase file name Do after creating the so that an AMD wants to call noConflict to hide version jQuery it will work Note that maximum portability libraries that are not jQuery should themselves anonymous modules and avoid setting a an AMD loader present jQuery a special For more information see https github com jrburke requirejs wiki Updating existing libraries wiki anon define define amd define jquery jQuery Map over jQuery overwrite _jQuery window jQuery Map over the overwrite _ window jQuery noConflict deep window jQuery window _ deep window jQuery jQuery window jQuery _jQuery jQuery Expose jQuery and identifiers even AMD comment https github com jquery jquery pull and CommonJS browser emulators noGlobal window jQuery window jQuery jQuery