JavaScript Coding Standards: Difference between revisions

From Wikipedia of the Dark Brotherhood, an online Star Wars Club
(import from google cache)
(getting rid of extraneous whitespace and weird html comment)
Line 26: Line 26:
==  Inline JavaScript  ==
==  Inline JavaScript  ==
Inline JavaScript - e.g. the use of HTML attributes such as: onclick, onmouseover, onmouseout, etc - is an outright no-no. Do NOT do this. Instead, opt for event binding.
Inline JavaScript - e.g. the use of HTML attributes such as: onclick, onmouseover, onmouseout, etc - is an outright no-no. Do NOT do this. Instead, opt for event binding.




==  jQuery  ==
==  jQuery  ==
The Brotherhood standardizes on the [http://jquery.com jQuery] library. All JavaScript should be written using jQuery; either using Core jQuery, jQuery plugins, or DJB created jQuery plugins.
The Brotherhood standardizes on the [http://jquery.com jQuery] library. All JavaScript should be written using jQuery; either using Core jQuery, jQuery plugins, or DJB created jQuery plugins.





Revision as of 21:34, 29 May 2011

Dark Brotherhood Coding Standards
Coding Standards and Practices
ASP Coding Standards CSS Coding Standards Database Standards
HTML Coding Standards JavaScript Coding Standards PHP Coding Standards

Inline JavaScript

Inline JavaScript - e.g. the use of HTML attributes such as: onclick, onmouseover, onmouseout, etc - is an outright no-no. Do NOT do this. Instead, opt for event binding.


jQuery

The Brotherhood standardizes on the jQuery library. All JavaScript should be written using jQuery; either using Core jQuery, jQuery plugins, or DJB created jQuery plugins.


Script Inclusion

Including JavaScript within script tags in the HTML is not advised. Use an external file where possible. This allows the individual files to be cached by browsers independent of the HTML file.