Depending on what browser you are using, I'd recommend installing a browser extension so that you can get some sort of log message to show what part of your js code is failing.
I use the developer tools compatible with google chrome. Firebug is another good alternative.
In addition, you can use this great code quality tool called JSLint which will provide you with excellent code analysis and prevent you from falling into bad practices when coding your javascript.