A Simple Logging Function for JavaScript
Tagged with: debug, firebug, function, JavaScript, library, logging, script
Monday, October 29th, 2007 10:46 PM
Prints all the arguments of the function. This function uses console.log if firebug is available - else, uses alert.
function p() {
for(var i=0; i<<arguments.length; i++) {
if(window.console) console.log(arguments[i]);
else alert(arguments[i]);
}
}