Created
April 2, 2010 19:31
-
-
Save afahy/353585 to your computer and use it in GitHub Desktop.
Simple plugin to log / dir jquery objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// allows you to log an object while staying in the chain | |
(function($){ | |
var console = ("console" in window) ? window.console : { "log": alert, "dir": alert }; | |
$.extend($.fn, { | |
log: function(){ | |
console.log(this); | |
return this; | |
}, | |
dir: function(){ | |
console.dir({ | |
elements: this, | |
length: this.length, | |
selector: this.selector, | |
context: this.context, | |
}); | |
return this; | |
}, | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment