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.

Awesome!

Advertisements
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

w

Connecting to %s

Advertisements
%d bloggers like this: