Klaus Hartl wrote:
> Ⓙⓐⓚⓔ wrote:
>
>> Mike, I don't like breaking the chains... I just insert a debug in the
>> middle of the chain...
>>
>> I use this for my debug:
>> jQuery.fn.debug = function(message) {
>> return this.log('debug:' + (message || '')
>> +"[").each(function(){jQuery.log(this);}).log("]");
>> }
>> jQuery.fn.log = jQuery.log = function(message) {
>> if (!message) message = 'UNDEFINED'
>> if (typeof message == "object") message = jsO(message)
>> if(window.console && window.console.log) //safari
>> window.console.log(message)
>> else if(window.console && window.console.debug) //firebug
>> window.console.debug(message)
>> else
>> jQuery("body").prepend(message+ "<br/>")
>> return this
>> }
>>
>
> Thanks Jake, very nice! While reading your first sentence I thought
> "What about a logger in the chain" and there you go ;-)
>
> Straight into my toolbox... :-)
>
> -- Klaus
I smell plugin ;)
~ Brice
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/