Board Thread:General Coding Help/@comment-24473195-20141103204653/@comment-11733175-20141105000833

One caveat with Penguin-Pal's suggestion, if you're using IIFEs. If you have something like /* script 1 */ ( function { ... } ); /* script 2 */ ( function { ... } ); it can have some weird effect if script 2 has a dependency on script 1. The simplest way to workaround it is to work with globals in script 1 (without using an IIFE) and then coding as normal in script 2, e.g. /* script 1 */ window.someVar = {}; /* script 2 */ ( function { ... } ); I'm not sure what causes the weird effect, I've asked around and think it's something to do with a side effect of how js is implemented.