jQuery Debug Console Plugin
Digital Fusion 2012By Sam Sehnert,
A simple, lightweight jQuery debugging plugin which lets you easily see what's in a jquery collection at any point in a chain, while still maintaining chain-ability.
Only 441 bytes gzipped.
The Demos for this plugin live under the examples/ directory. Open them directly in your web browser, or view the following online example:
Basic console usage
Print the list of elements to the console as they are at the current time in the jQuery collection:
You can use this in the middle of a chain to figure out what elements are currently selected:
There is also an easy shortcut to print console.log, console.warn and console.error messages:
$.console( 'My log message' ); $.console( 'warn', 'My warning message' ); $.console( 'error', 'My error message' );
We support arbitrary arguments:
You can even turn off all console messages with the flick of a switch:
$.console( 'disable', true ); // false to turn it back on.