Not only you can try to figure out the problem easily and suppose you are stuck and can not go anywhere and not sure how to troubleshoot, your next best bet to ask the question in stack overflow or in some other forum. Normally you will end up putting the code in the question and you hope you explained the problem properly so that someone could answer. Well, with jsFiddle all these issues are gone, explain the problem, share the jsFiddle link where you recreated the problem so that people can really see what is the real problem and they can easily identify the problem and help resolve your issue. Trust me with jsFiddle link in your question, the turn around time for your answer will be very short.
So if you do not have jsFiddle account, go create one and you will thank me later.
The second trusty took you need is Chrome (IE also have developer tool support). Try to browse the web site in chrome and pressing F12 will give ton of features which will make your debugging so easy. Day before yesterday I ran into a problem when I was using web matrix. I was trying to read a JSON file from my data directory and no data returned. By using Chrome, I could see, the call was going out in the network tab and server was returning 404 error. So I know it was not my program problem. Also when the program is running, you can inspect all the local variables, execute simple comments on console. There are lot of link on both of them, use it, it will help your development a lot.