2. Summary
• This presentation is about sharing the best new
features and why they matter. Code samples are
aplenty in the jQuery API docs.
• What’s cool in jQuery recently (1.4 - 1.6)
• Other jQuery news
• Brief opinions about jQuery and grown up
JavaScript
3. jQuery != JavaScript
• jQuery is the new PHP in terms of a low barrier of entry
leading to poor programming practices becoming the norm
• It’s a community problem, not a jQuery problem
• Examples need to stop using spaghetti code and use
namespaces and proper programming patterns
• If you’re writing serious amounts of JS code, you’re going to
need a framework to help you organise your code
• Learning how to more easily and consistently handle async
code challenges, e.g. PubSub, methods receiving success and
error callbacks for loose coupling.
4. About me
• Front End Dev Tech Lead at Flight Centre (FCL)
from 2009 - 2011
• FCL heavily relies on JS for interactivity and
features. We maintain around 30 websites with15
Front-End Developers.
• jQuery saves our bacon everyday
• jQuery isn’t the car, it’s the toolbox to pimp the
car.
5. About jQuery
• Rocks! Fast! Small! Easy! Clean and concise API!
• Not a framework, it’s a toolkit
• Not a substitute for learning JavaScript properly
• IS a substitute for replacing browser quirks and
inconsistencies with a clean and simple one
• Excellent collection of jQuery plugins available
6. jQuery 1.4 - Jan 2010
http://jquery14.com/day-01/jquery-14
• API Standardisation for setter methods
• Access “data-...” attributes via $.data
• jQuery.type is awesome
• Strict JSON parsing via Ajax if JSON available
• jQuery.delegate() over jQuery.live()
7. jQuery 1.5 - Jan 2011
http://blog.jquery.com/
http://blog.jquery.com/2011/01/31/jquery-15-released/
• Ajax module rewritten, returns jQuery ajax
instance
• Ajax gets promises (deferred callbacks, nicer API)
• Ajax “context” option (actually added in 1.4)
• Clean way override/extend/modify jQuery with
jQuery.sub
8. jQuery 1.6 - May 2011
• That was quick... Because of breaking API changes
• .attr() meets .prop(). Making jQuery act more like
the underlying API.
• Deferreds improve with .deferred.always() and
deferred.pipe()
• $.animate gets promises
• .data when imports attributes based on W3C
HTML5 spec (camelCase,)
9. jQuery news
• jQuery mobile is in Alpha 4.1
• “Official plugins” now means “maintained by Core
jQuery team” (tmpl and data link plugins from
Microsoft not official, tmpl not going into core)
• Increased community contributions fuelling
jQuery’s rapid development
• Add your proposed change for jQuery 1.7 at
http://goo.gl/spjIE
10. Summary
• jQuery is a tool that allows easy and rapid development across
the most common browsers
• It can’t help you organise or structure your code, only you can do
that. Good frameworks can help, greater knowledge can help
more.
• Current focus is on making it fast and improving API stability and
consistency.
• Look outside the jQuery plugin ecosystem for solutions that are
beyond jQuery (underscoreJS)
• Don’t write re-usable jQuery code that relies on $ being global.
Pass jQuery into a self executing function surrounding your code.