M
Matt Kruse
http://www.javascripttoolbox.com/bestpractices/new.php
I've updated my Best Practices document to include more content and more
supporting arguments for the recommendations. Also, I've added #anchors to
each recommendation so linking to a specific recommendation is possible from
posts here, etc.
I would love to get feedback from the experienced developers here. If you
see any technical errors or have any suggestions, please let me know so I
can update the document before making it "live".
The TOC is as follows:
1. Always Use 'var'
2. Feature-Detect Rather Than Browser-Detect
3. Use Square Bracket Notation
4. Avoid 'eval'
5. Reference Forms and Form Elements Correctly
6. Avoid 'with' Statements
7. Use onclick In Anchors Instead Of javascript: Psuedo-Protocol
8. Use The Unary + Operator To Cast To Number
9. Avoid document.all
10. Don't Use HTML Comments In Script Blocks
11. Avoid Cluttering The Global Namespace
12. Avoid prototype.js
13. Avoid sync "Ajax" calls
14. Use JSON
15. Use Correct <script> Tags
I've updated my Best Practices document to include more content and more
supporting arguments for the recommendations. Also, I've added #anchors to
each recommendation so linking to a specific recommendation is possible from
posts here, etc.
I would love to get feedback from the experienced developers here. If you
see any technical errors or have any suggestions, please let me know so I
can update the document before making it "live".
The TOC is as follows:
1. Always Use 'var'
2. Feature-Detect Rather Than Browser-Detect
3. Use Square Bracket Notation
4. Avoid 'eval'
5. Reference Forms and Form Elements Correctly
6. Avoid 'with' Statements
7. Use onclick In Anchors Instead Of javascript: Psuedo-Protocol
8. Use The Unary + Operator To Cast To Number
9. Avoid document.all
10. Don't Use HTML Comments In Script Blocks
11. Avoid Cluttering The Global Namespace
12. Avoid prototype.js
13. Avoid sync "Ajax" calls
14. Use JSON
15. Use Correct <script> Tags