Simplest cross-browser console.log() caller
Simply embed this function into global JS file and call log(argument)
to print variable in the console.
function log(msg) {
return; // comment this out to enable debugging
if (window.console) {
console.log(msg);
} else {
alert(msg);
}
}
To get more powerful log()
, please check Paul’s blog.
Twitter · Facebook
Linkedin · Delicious
GitHub · Douban · Xbox Live