If you want to use console.log()
and have it not bomb out in IE when the IE debugger is not running, you can place the following in your javascript at the global scope before any console.log()
statements execute to give you a dummy console.log()
that will keep your console.log()
statements from causing errors:
if (!window.console) {window.console = {};}
if (!console.log) {console.log = function() {};}
Of course, if you actually want to see the console.log()
output in IE, then you will have to run the IE debugger which will cause console.log()
to get defined or use some other debugging environment that defines it.