console.log and IE8, IE9

Wow, ashamedly just discovered that console.log is not cross browser safe. Should check for the existence of console object first. May even be better to append text to a hidden <div> to be completely safe.

In the words of "f055" on this page

I can un-proudly say that for the many years I developed for the web I assumed console.log is supported by all major browsers. I just spent a day working out why IE9 doesn't like my script and now I know why - it had a console.log in the very first step. Impossible to debug, since turning debug mode made this bug go away in an instant :P Thanks for clarification!!

Leave a Reply


Quick Support