Javascript alert is bad

Hi,

Just a quick post.  I just decided to NEVER use the javascript alert function for debugging again.

  1. It's a pretty crude method of debugging.
  2. If you get an alert in a loop, get ready to close 100 pop ups.  (Some browsers are cool about this)
  3. Oops, I forgot to take it out when I deployed to the test system.  (Like I just did)
  4. There are probably other reasons, like what happens when you test your code outside of a browser?
Anyway, I already have a wrapper around console.log() that will be graceful if console.log is not available, so I need to remember to use that instead and forget about alert()!

Comments

Popular Posts