Take the 2-minute tour ×  I have some Javascript code. I want to
trace errors and debug it. how to do it ?  share|improve this
question Debugging is usually done with a debugger... which is
present in almost every modern browser. Try pressing F12 or
looking over the menus. –  DCoder Sep 12 '12 at 7:15 Which
browser do you use? (IE's forbidden) –  sp00m Sep 12 '12 at 7:15
Mozilla Firefox –  H H F Sep 12 '12 at 7:27 add comment  3
Answers  up vote 2 down vote accepted  It used to be that
debugging in javascript was quite limited. You could post alerts
to indicate variable states or print information to the web
page. In the case of syntax error, it would simply not execute
all the code (meaning you had to place alerts prior to the error
to know where it was).  Thankfully, browsers have caught up.
Firebug is very useful as well as Chrome's developer tools which
both use breakpoints, expression evaluation, as well as a series
of other useful tools for debugging in-browser. I would suggest
you look into these. I be