One thing that helps if you have issues, is to post your script on a javascript validator site, like here: <a href="https://closure-compiler.appspot.com/home" rel="nofollow">https://closure-compiler.appspot.com/home</a> I know what I'm doing (mostly), and I still use it all the time to catch typos and missing semi-colons and the like.