How to use jQuery to log values to Firebug Console?
问题 I just wonder if there is a way to use jQuery to log some variable values to Firebug console for debugging purpose? 回答1: jQuery is just a library for JavaScript, so you can just use the console.log() function: console.log(myVar); 回答2: (function($) { $.log = function() { if( 'console' in window ) console.log.apply(null, arguments); }; }(jQuery)); $.log("hello world, I'm just kidding with this answer, please upvote it anyway!"); $.log("You should really just call console.log() directly"); $.log