On this page... (hide)

General

console.log doesn’t work in InternetExplorer if the F12 developer tools is not open.
(window.)console is only defined with the developer tools.

 

so

 

if (!window.console) {
    window.console = {
        log: function(obj){ /* define own logging function here, or leave empty */ }
    };
}

 

 

check out http://stackoverflow.com/questions/7585351/testing-for-console-log-statements-in-ie for a robust solution.

 

 

See Also

Debug
Windows.Logging

 

 

Tags

JavaScript