> > 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.
> From: Michael Geary > 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. And just so there's no misunderstanding, if you prefer a different format, that's cool. I just wouldn't go changing this if the only reason is to placate JSLint. JSLint can be a very useful tool, but it can be overly fussy about a few things like this. -Mike