Javascript Best Practices

From DevSummit
Jump to navigation Jump to search

Facilitated by Neil Drumm, Drupal

Neil will share his learnings around best practices for implementing Javascript, focusing on making things fast. The session will draw on the work he has done on API.drupal.org, including smart dynamic “autocomplete” features. While Neil's focus will draw primarily on experiences with the JQuery library, he'll share thoughts on writing good and fast JavaScript for other frameworks as well. Some notes are at http://delocalizedham.com/node/21.

Session Notes

Neil's previous presentations

 http://delocalizedham.com/badcamp-2009
 Chapter 3 blog post by Neil Drumm last month

JavaScript: The Good Parts by Crockford

 Use JSLint

Use FireBug IE debugging is hard

 Recent blog post on ejohn.org

Testing

 Selenium
 Contiunuous integration if you can

Closures Don't use AJAX if you don't need to Use YSlow Use tokens to prevent XSRF Start with a pile o' JS and build APIs as you need them Check out the jQuery utility functions