By the way, I meant how would you do interactive debugging (with watches and
such) inside something like a .keyup(function(){ buggy code that needs love
}); or any other function assigning ...err...function. .each, for example.
I tried setting breakpoints in the middle of all that but stepping through
it brought me into the jquery code and I got lost in the variables.
Maybe experience will help...
Michael Geary wrote:
>
> That's a nice trick, Jake - thanks for posting it!
>
> Both approaches have their use. Your log plugin is great for console
> logging, while breaking up the chain is great for interactive debugging
> because you can set a breakpoint between lines.
>
> -Mike
>
>> 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
>> }
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
--
View this message in context:
http://www.nabble.com/What-tools-should-I-use-to-troubleshoot-jquery-problems--%28John-Resig%2C-jquery-team%2C-other-gurus-please-share-your-tricks...%29-tf3066235.html#a8552828
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/