I'm not sure that jQuery has coding stanards, but I like this form for anonymous functions in plugins. It's succint and readable. I'm totally down with 2 spaces being the indentation standard. I prefer tighter lines of code in my JS and tend to use single line conditional constructs alot.<br>
<br>$('div').each(function() {<br> // do my stuff.<br>});<br><br>.darrel.<br><br><div class="gmail_quote">On Mon, May 19, 2008 at 11:38 AM, David Timothy Strauss <<a href="mailto:david@fourkitchens.com">david@fourkitchens.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>I'd rather use jQuery's standards as a foundation rather than Drupal's PHP ones, unless we have a good reason to do otherwise.<div>
<div></div><div class="Wj3C7c"><br><br>----- "Stella Power" wrote:
<br>> Heya,<br>> More and more contrib modules are including JavaScript files, so I want to add the ability to review JavaScript files to the <a href="http://drupal.org/project/coder" rel="nofollow" target="_blank">Coder</a> module. However, step 1 is we need to agree on what coding standards we should be using for JavaScript.<br>
>
<br>> At present we have the <a href="http://drupal.org/node/172169" rel="nofollow" target="_blank">Coding standards for JS files</a> doc which has one or two ideas but isn't complete. We also have the main <a href="http://drupal.org/coding-standards" rel="nofollow" target="_blank">Coding Standards</a>
doc, and while most are transferable to JavaScript, not all are. So I've put some suggestions together at <a href="http://drupal.org/node/260140" target="_blank">http://drupal.org/node/260140</a> A fair few of them come from the standards used by JSLint so there shouldn't be many surprises. I'd really appreciate a discussion/debate on this and hopefully we can agree on the coding standards we want to use.<br>
>
<br>> Cheers,<br>> Stella<br>>
</div></div></div></blockquote></div><br>