If an alert() won't help me, I generally use a variation on the method shown above by Lesshardtoofind, you can also use Firebug in Firefox, the JavaScript Console in Chrome, or Internet Explorer's built-in debugging tools to monitor variables and set breakpoints.