Created
October 31, 2010 19:32
-
-
Save twalker/657034 to your computer and use it in GitHub Desktop.
sub-module that loads itself dynamically to its parent
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
// sub-module that loads itself dynamically to its parent | |
// see: http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth | |
var UTIL = (function (parent, $) { | |
var self = parent.ajax = parent.ajax || {}; | |
self.get = function (url, params, callback) { | |
return $.getJSON(url, params, callback); | |
}; | |
// etc... | |
return parent; | |
}(UTIL || {}, jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment