Created
January 26, 2012 18:44
-
-
Save clauswitt/1684302 to your computer and use it in GitHub Desktop.
Module including jQuery and session.js, and then removing them from global scope
This file contains hidden or 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
| //My own global object | |
| var clauswitt = (function($, s, c, undefined) { | |
| //Make sure the module is an object. | |
| c=c||{}; | |
| //Set session object on the module (session from session.js) | |
| c.session = s; | |
| c.init = function() { | |
| //Deleting global objects | |
| delete window.session; | |
| delete window.jQuery; | |
| delete window.$; | |
| }; | |
| //Call init when dom is loaded. | |
| $(c.init); | |
| //return the module | |
| return c; | |
| })(jQuery, session, clauswitt); //include jQuery, session.js and the global object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment