IE 9 – doesn’t like console.log()

Turns out you can use console.log in IE 9, but it only works in developer mode.

Fine, so the sensible thing in “not developer” mode would be for console.log to by turned into a NOP. This doesn’t seem to happen and random things were breaking until I commented out the console.log lines. It looks like trying to do anything with the console object throws an exception – not even

alert("console null?"+console==null);

is allowed (no alert gets shown).

Just another one of those annoying “it’s works in the debug version” things, and everyone the world over has to build their own console.log wrappers.

This entry was posted in Uncategorized. Bookmark the permalink.

5 Responses to IE 9 – doesn’t like console.log()

  1. matt burns says:

    I had the same problem a little while back. Some code I stole borrowed was actually barfing and causing the js to throw for me.

    Pfft. Who needs logging anyway..?

    • tomblench says:

      Thanks Matt, glad it’s not just me.

      I swear writing javascript is one of the most frustrating programming activities I’ve done (or is it EJBs? hmmm…)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>