An Event Apart: Integrating JavaScript Effectively

by Luke Wroblewski December 8, 2009

At An Event Apart San Francisco, Jonathan Snook discussed Integrating JavaScript Effectively and demonstrated several examples of developing rich interactions for the Web

  • HTML gave us links, inputs, and content markup. Not rich interactions.
  • CSS gave us limited functionality through focus, hover, and active states. Now more things are being integrated through transitions and animations.
  • But Javascript provides everything else: enhanced user experiences by improving perceived application speed and rich interactions.
  • In order to build on a solid foundation, start with HTML first. You need a usable based of links and form elements. Implement your accessibility requirements before integrating Javascript.
  • What kind of HTML should you use? It doesn’t really matter but you can code HTML5 like HTML 4.01. HTML5 has better (more simple) doctype, script, and style elements.
  • Should you create your own Javascript? It depends on what the interaction needs to be and how much of it there will be. 5 lines of code vs. a 38k library file.
  • JQuery (a Javascript library) makes your life easier by solving cross-browser issues, simplifying how you work with the DOM, providing built-in animations, plug-in repositories, and the ability to roll your own.
  • Full libraries for user interfaces: JQuery UI, JQuery Tools, YUI, ExtJS, and Dojo.
  • Don’t apply styles at the Javascriot level, do it at the CSS level.
  • People that are building plug-ins for JQuery care about the underlying HTML and the interactions. So the details are often thought through.