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.

6 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…)

      • Andrew Turner says:

        Let me fix that for you:

        “Writing javascript that works in IE is one of the most frustrating programming activities I’ve done”


        • tomblench says:

          I totally agree Andrew.

          I see your post came from – glad to be amongst such exulted company on the blog!

        • Derek says:

          Totally agree with you! :) IE is the worst web browser ever.

        • Joshua says:

          Yes–I am experiencing this very same problem. Wrote a simple survey for a political agency and it requires a simple interdependent select. I use console.log to render the options after they are removed. Not really sure how I should fix this…unless I completely re-write the script in Javascript instead of jQuery…I can do it completely old school with a two dimensional array list but I’m trying to avoid that. Seems outdated, but then again SO DOES IE! Why do my customers insist upon having IE compatibility when it’s so obvious IE cares nothing about web standards.

Leave a Reply

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