It can be frustrating sometimes tracking down JS parse errors since the API scripts are being parsed through eval, making it impossible to return line numbers. One tip is to use jshint ( <a href="http://www.jshint.com/" rel="nofollow">http://www.jshint.com/</a>) to preparse your script. This will return more than errors, it will also return suggestions on ways to improve your code. Additionally, most editors have plugins that allow you to jshint right inside the app.