javascript - What is the meaning of the "t" in the code and what does t(window) mean? -
I am trying to learn jquery / javascript by looking at the source code of some websites. I am a bit unsure about the syntax used there:
! Function (t) {"strict experiment"; Function e () {var e = parseInt (T (window) .scrollTop ()), n = 10; E & gt; En? A.addClass ("new-class"): (a.removeClass ("new-class"), T (".class"). RemoveClass ("fclass")) // more code ...} (JQuery) ,
I really do not really know what exactly that t means. Is this "this" or just a commodity? And what does T (window) mean? I thought it should be something like T. Windo? Since there is no T function
Thanks! Saldtch
T
is the context of jQuery
that Object within the scope of the function Notice how the function is called:
! Function (t) {// "t" is jQuery object} (jQuery); The
function is defined and then immediately applied with the parameter jQuery
. Therefore, when the function is applied, the parameter is being passed which is stored in variable t
You can name it anything, in fact:
! Function (foo) {// "foo" is jQuery object} (jQuery);
Comments
Post a Comment