Hi, please Register

Preventing console.log from breaking browsers

If you don’t want console.log or other console statements to break browsers that don’t support them you need to include this piece of Javascript before anything else:

if(!console)
{
  var console = {
    log: function() {},
    error: function() {},
    warning: function() {}
  };
}

One Comment

  1. lehrburger 02:41, Oct 28th, 08

    http://lehrblogger.com/2008/10/28/gui-design-in-ajax-keyboard-implementation-specifics/
    console.log fixes, version control info, flickr example, more detail on keyboard project

2 Trackbacks

  1. [...] from my use of console.log for debugging in Firebug. David Nolen (the course instructor) posted a solution to this issue, and all past projects should now be working. I also fixed a few other [...]

  2. [...] from my use of console.log for debugging in Firebug. David Nolen (the course instructor) posted a solution to this issue, and all past projects should now be working. I also fixed a few other [...]

Post a Comment

You must be logged in to post a comment.