When wrapping code inside a function, i pass jQuery at the bottom and the $ sign as a parameter to add it to the functions scope.
(function(window,$,undefined){
}(window, jQuery));
How can i do that with my own Objects?
I load my object in a separate script tag
function MyObj (){
}
So i guessed that all it takes is
(function(window,$,MyObj){
var myObj = new MyObj();
}(window, jQuery, MyObj));
But MyObj is undefined. I know i could wrap MyObj inside an IFI - but MyObj also needs some json-data that isnt there on page load...
Thanks for your help.