Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple, lightweight debugging plugin which lets you easily see what's in a jquery collection at any point in a chain, while still maintaining chain-ability
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
LICENSE.txt
README.markdown
jquery.console.js
jquery.console.min.js
package.json

README.markdown

jQuery Debug Console Plugin

By Sam Sehnert, Digital Fusion 2012

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.

Demos

The Demos for this plugin live under the examples/ directory. Open them directly in your web browser, or view the following online example:

Documentation

Basic console usage

Print the list of elements to the console as they are at the current time in the jQuery collection:

$('.selector').console('My Elements');

You can use this in the middle of a chain to figure out what elements are currently selected:

$('.selector').console('Unfiltered').filter(':not(.complete)').console('Incomplete (filtered)')

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:

$('.selector').console('Test',[1,2,3],{a:1,b:2,c:3})

You can even turn off all console messages with the flick of a switch:

$.console( 'disable', true ); // false to turn it back on.

License

Copyright 2012, Digital Fusion, Released under the MIT license.

Something went wrong with that request. Please try again.