思路话语

。Arlen:思想有多远你就能走多远...

jquery debug plugin

http://trainofthoughts.org/blog/2007/03/16/jquery-plugin-debug/

 

 

Features

This jQuery plugin provides the following main features:

  1. 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.
  2. 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.
  3. 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>

posted on 2009-03-10 20:40  Arlen  阅读(870)  评论(0)    收藏  举报

导航