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.
I had the same problem a little while back. Some code I
stoleborrowed was actually barfing and causing the js to throw for me.Pfft. Who needs logging anyway..?
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…)
Let me fix that for you:
“Writing javascript that works in IE is one of the most frustrating programming activities I’ve done”
🙂
I totally agree Andrew.
I see your post came from arm.com – glad to be amongst such exulted company on the blog!
Totally agree with you! 🙂 IE is the worst web browser ever.
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.