Let us say I have a HTML page that contains a javascript file:
The base.js is like this:
$(document).ready(function () { obj.init(); } // .....
You should define obj before referencing it.
obj
Also, document.ready doesn't mean that the resources will be loaded, only that the document been parsed, so the resources load between document ready and the $(window).load event.
$(window).load