This is an excellent 25min that (the one and only) John Resig gave at the Future of Web Apps conference in Miami 2010.
If you don’t know when to use the new features of jQuery 1.4.2 like: .live and .delegate events – you must see it.
Main points to take home with you:
- Event delegation – Event delegation is a technique that routes around the traditional method of binding events. You must understand it and start using it if you have apps that use a lot of DOM elements. The example he gave was of a table with 10,000 cells. You do not need to bind the event to each cell but rather one event to the table element and by using the bubbling of events in the browser these events will be executed with less code and more efficiency.
- Use CDN. What is a CDN you ask? Well, A CDN is short for Content Delivery Network and what that effectively translates into is a bunch of geo-position data centers around the globe. Not all of us have the finances to build a whole bunch of data centers all around, but there are a number of great services that handle this. Amazon CloudFront is one that we (at High Gear Media) use and they are good and cheap.
- Minifying and gzipping your JavaScript. Easy and save lots of time. Performance – performance – performance (like Steve balamer like to say).
- Use jQuery UI and don’t re-invent the wheel. jQuery UI is a set of components and set of widgets that you can use, you can drop into your application, and they will just work. I’ve used them over and over again and each time they are getting better and better with a great API that let you (the developer) all the power to customize and work with them.
Discover more from Ido Green
Subscribe to get the latest posts sent to your email.
Pingback: Advanced jQuery & Javascript For Your Web App « Ido's Blog | Source code bank