> From: polyrhythmic
> Also, I don't recommend splitting your .'s... jQuery code is 
> more often written like so:
> 
> $(obj).fn({
> //function code here
>  }).fn2(options).fn3();
> 
> Not splitting your ) and . makes JSLint happy as well.  The 
> first thing I did was run the code through JSLint and it 
> won't process it even with "Tolerate sloppy line breaking" 
> enabled.

Well... The style that Piotr was using:

   $('#settings')
      .bind('submit', this.saveSettings)
      .find('[EMAIL PROTECTED]').bind('keyup', this, function(e) {
         ...

happens to be the style that John and I and a number of other jQuery developers 
and users prefer. I think it is by far the cleanest
way to format chained methods.

If JSLint doesn't like it, then as I see it that's JSLint's problem. :-) 
Fortunately, "Tolerate sloppy line breaking" turns off
those particular warnings, and most of the rest of JSLint's warnings on the .js 
file (http://riddle.pl/emcalc/emcalc.js) look like
they are worth fixing.

-Mike

Reply via email to