I’m doing it like this:
;(function($, window, document, undefined){
var MyNamespace= MyNamespace || {};
$.MyNamespace.someMethod = function(){
// code
};
$.MyNamespace.someOtherMethod = function(){
// code
};
$.MyNamespace.someProperty = {};
// etc.
}(jQuery));
is it ok?
Modified code :
there are two problem.
MyNamespace is property of $.
and window and document are not available inside function body.