javascript - How jQuery is available outside the closure scope? -
sorry if type of question asked many times before i'm little unclear jquery coding here:
from http://code.jquery.com/jquery-latest.js
(function(global,factory){ //some checks , coding })(typeof window !== "undefined" ? window : this, function( window, noglobal ) { //coding stuff })
so, jquery using coding in closure how jquery available outside scope?
in end of iefe closure can see lines
// expose jquery , $ identifiers, in // amd (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // , commonjs browser emulators (#13566) if ( typeof noglobal === strundefined ) { window.jquery = window.$ = jquery; }
where export $
, jquery
identifiers global window
object. function // coding stuff
second argument of iefe posted, , - factory
called appropriately depending on module loaders available (or not).
Comments
Post a Comment