-
-
Save mishterk/aca2cd354521a70e38ca54282b2f8c20 to your computer and use it in GitHub Desktop.
A jQuery closure for basic encapsulation. For more info, see https://philkurth.com.au/tips/use-closures-for-basic-encapsulation-when-writing-jquery/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($, window, document, undefined) | |
{ | |
// Write your jQuery here. Any JavaScript you write in here | |
// is scoped so you don't have to worry about symbol names | |
// clashing with each other. | |
// You can define functions in here that are only available | |
// in this scope. | |
function my_scoped_function(){ /* … */ } | |
})(jQuery, window, document); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment