Saturday, January 11, 2014

15 jQuery Tips and Tricks to Increase Performance

jQuery has been widely used in several websites to make use of available libraries. Though the API itself is already optimised, it is still possible to enhance its performance.

Here are 15 tips and tricks by the Web Revisions.
  1. Always Use the Latest jQuery Version
  2. Always load CDN-hosted copy of jQuery
  3. Always use ID as Selector Instead of Classes or Name
  4. Always Cache jQuery Objects before use
  5. Always use Tags Before Classes
  6. Use Chaining
  7. Just give your Selectors a Context
  8. Storing Data
  9. Preloading images
  10. Try to make code simpler using group queries
  11. jQuery Lazy Loading
  12. Always Return False
  13. Use join() for Longer Strings
  14. Try to avoid DOM Manipulation
  15. Check if an Element Exists

No comments:

Post a Comment

Do provide your constructive comment. I appreciate that.