Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

ReferenceError: console is not defined. Since Firebug 1.2 you need to call window.loadFirebugConsole() in order for console.log and friends to work.

Tagged , , ,

2 comments

  1. Sweet. Another variant of that code is to rewrite console.* as empty functions. This way you can put your code in production without removing debug lines from your code and also avoid filling your user's firebug with stuff.

    Example: idonothing = function() {}; console.log = console.error = console.info = console.warn = idonoting;

    Of course, if possible, these lines should be removed, to avoid bloated js files that have to be downloaded. But if you're leaving them in anyways, at least, do it silently.

    André Luís - 24th December 2008 13:37 - #

  2. Are you sure about this ? I've been using Firebug 1.2 for a while and i never needed to call that method in order for console.log to work. That probably only applies if you haven't manually enabled the console on the website you are trying to debug.

    Tiago Rodrigues - 24th December 2008 15:22 - #

Comments are closed.
A django site