Thanks to Breton and SeanJA for their suggestions for testing directly in the console and creating the sample file. Having done this, I realized that console.log actually works in an isolated environment. This made me realize that this should be something special for my development environment. Checking, I found that JavaScript was loaded at an early stage, designed to define a console object for browsers that do not support Firebug.
if (!("console" in window) || !("firebug" in console))
{
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {}
}
This was written before Safari implemented a console object for its error window.
I deleted it and now everything is working fine. Thanks guys.
source
share