jquery debug plugin
http://trainofthoughts.org/blog/2007/03/16/jquery-plugin-debug/
Features
This jQuery plugin provides the following main features:
- global jQuery method $.debug([true|false])
This is the global jQuery method which can be used to get and set the flag which indicates whether
debugging is enabled or not. The default is the value of the debug attribute of the <html> node or the value false. - global jQuery method $.log(message)
This is the global jQuery method for logging message to either Firebug, Firebug-Lite or the home-brewn minimum Firebug emulation console. - jQuery object method $(…).log([message])
This is the jQuery object method for logging the jQuery items in the jQuery object and optionally the message to either Firebug, Firebug-Lite or the home-brewn minimum Firebug emulation console.
Trivial Example
<div id="test1">TEST1</div>
<div id="test2">TEST2</div>
<script type="text/javascript">
$("console.log").ready(function(){
$.debug(true);
$.log("plain debug message");
$('#test1').log();
$('#test2').log("with message");
});
</script>
浙公网安备 33010602011771号