• What can I do for you
  • Random
  • Archive
  • RSS
  • Ask me anything

Moisés García

Web Technology Specialist

Javascript Best Practices

Table Of Contents

  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: Pseudo-Protocol
  8. Use The Unary + Operator To TypeConvert To Number
  9. Avoid document.all
  10. Don’t Use HTML Comments In Script Blocks
  11. Avoid Cluttering The Global Namespace
  12. Avoid sync “Ajax” calls
  13. Use JSON
  14. Use Correct <script> Tags

  • 1 month ago
  • Comments
  • Permalink
  • Share

Recent comments

Blog comments powered by Disqus
← Previous • Next →

Portrait/Logo

About

Passionate web designer & developer, Tech lover, internet specialist and always hungry for knowledge.

Now located in Almería, Spain
Father of two, husband of one.

Where I Am

  • @moisesgarcia_es on Twitter
  • Facebook Profile
  • Google
  • Linkedin Profile

Twitter

loading tweets…

Dreamhost, hosting provider

Following

I Dig These Posts

See more →
  • Photo via staff

    We’re very excited to welcome Spanish into our roster of supported languages!

    Spanish is now our seventh language, following English, German,...

    Photo via staff
  • Link via azharkamar
    DHTMLX 3.0 – JavaScript UI Library with Visual Designer Tool
    Link via azharkamar
  • Photo via monochrom23reich

    Étienne Jules Marey

    Photo via monochrom23reich
  • Photo via ohscience
    The terrain for the scientific work conducted by ICESCAPE scientists on July 4, 2010, was Arctic sea ice and melt ponds in the Chukchi Sea. The...
    Photo via ohscience
  • Photo via gripitnripit

    Chewbacca Dog! I want it!

    Photo via gripitnripit
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr