Skip to content

Instantly share code, notes, and snippets.

@clauswitt
Created January 26, 2012 18:44
Show Gist options
  • Select an option

  • Save clauswitt/1684302 to your computer and use it in GitHub Desktop.

Select an option

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
//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