Splitting up the lines helps visually, and Firebug will step to each  
line. However, even without splitting them up, you can step-in, step- 
out, step-in, step-out on any chained line, and Firebug will happily  
step into and out of each method.

That said, jQuery makes it quite possible to reduce an entire  
application to a single line of code. Please resist this temptation,  
or if you cannot, split up the statements as Benjamin has shown :)

-Mike

On Dec 27, 2007, at 7:09 PM, Benjamin Sterling wrote:

> Mike,
> Is there a particular problem that you are trying to debug?  In the  
> beginning, I would put console.log in the callbacks (if the method  
> had one) and that allowed me to see when one thing was be executed.   
> Another tip that should probably help, instead of doing.
>
> $('p').css('color','red').slideDown().css('font-weight', 'bold');
>
> do:
>
> $('p')
> .css('color','red')
> .slideDown()
> .css('font-weight', 'bold');
>
>
> This, to me, makes it a little more human readable and easier to  
> comment out a line.
>
> On 12/27/07, Mike Schinkel < [EMAIL PROTECTED]> wrote:
>
> Hi all:
>
> I'm relatively new to jQuery and I see chaining methods touted as  
> one of
> it's best features.  However, I fine it very hard to debug a chained  
> method
> because of inability to see the intermedia states in Firebug.  It  
> currently
> seems to me to be one of those "sounded like a great idea at the  
> time but in
> use not very practical."
>
> Does anyone else feel this way about chained methods and/or is there  
> a way
> to step through the chain and see the intermediate states and  
> results on the
> page while debugging?
>
> Thanks in advance.
>
> --
> -Mike Schinkel
> http://www.mikeschinkel.com/blogs/
> http://www.welldesignedurls.org
> http://atlanta-web.org
>
> P.S. Don't take this as criticism of jQuery; and am quite enjoying  
> using it
> and generally quite like its architecture.
>
>
>
>
> -- 
> Benjamin Sterling
> http://www.KenzoMedia.com
> http://www.KenzoHosting.com
> http://www.benjaminsterling.com

Reply via email to