← recent

Firebug's Console Pitfall

Beware – if you leave a reference to the ‘console’ object in your javascript and deploy it out, your site will not behave!

I absentmindedly deployed code with a ‘console.debug()’ in the javascript, and a quick test showed the site to be functioning. When I tried again in the morning (from my work computer), a dropdown was unpopulated. I enabled firebug for the site to check things out, but when the page reloaded things were fixed.

Whenever it was that I learned about the console object, I just took it for granted, and didn’t bother to look up anything about it. So, not only did I not realize that it’s provided by firebug (and only available when console is enabled for the site), but I also have been missing out on a variety of other cool methods off of console, such as dir(), trace(), and profile(): API