Debugging Javascript

Apr 03 2008

Debugging Javascript can be a pain. Most of the time you use alert() calls or some other mechanism to trace information, but this is clunky at best. Even if you have a full fledged debugger at your disposal, debugging javascript can be a pain.

But when I found out about the “debugger;” statement. This is essentially a hook into the debugger you have installed: when the engine encounters this, I’ll fire up a debugger and set the current execution point to the debugger call. You can step through your code from there.

Nice.

3 responses so far

  1. Firebug FTW zou ik dan zo zeggen.
    Watches, Stacks en Breakpoints …

  2. True, daar heb je weinig aan als je voor IE aan’t ontwikkelen bent.

  3. Visual Studio 2008 biedt verdomd goeie debug-mogelijkheden voor javascript… Maar daar ben je vet mee als je PHP ontwikkelt natuurlijk (ik weet niet in je geval)

Leave a Reply