Thursday, May 17, 2012

Javascript console.log() and IE

Arg how I loath IE, why doesn't it support console.log(obj)?

To prevent IE from throwing an exception when it encounters console.log, add the following to a site-wide js file:

if (!window.console) console = { log: function () { } };


This makes cross browser testing much easier while in development.

No comments:

Post a Comment