I have a huge script with messy dependencies to other js files. My problem is, I need to include the script on various pages but not the other js files. and it stucks when some of variables are there which are defined in other files, I can handle them one by one but just have not enough time to do so.
I want to know is there any mechanism just like php autoloaders in javascript so whenever it gets something undefined, I can hook a chunk of code to handle that.