Created
January 27, 2014 14:15
-
-
Save simaovergalho/8649279 to your computer and use it in GitHub Desktop.
Javascript: Module Pattern
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
var UTIL = (function (parent, $) { | |
var my = parent.ajax = parent.ajax || {}; | |
my.get = function (url, params, callback) { | |
// ok, so I'm cheating a bit :) | |
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