Using alert()s is a bad idea!

When I debug JavaScript I use a combination of firebug and alert()s. The problem is when dealing with a thousands of lines of JavaScript eventually, I ‘might’ forget to remove an alert(). You can only image what happens when the .js is pushed live..

So to prevent an alert() from disrupting your clients, use:

console.log(“something” + someData.d);

This will write to your firebug console.


  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: