How to avoid console errors in older browsers

16 April 2014 · a minute to read



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