- Always use the latest version of jQuery as your website will be benefited from performance improvement done by the jQuery team in latest release. Learn "How to always reference latest version of jQuery"
- Be smart while using selectors. As there are many ways to select element using selectors but that doesn't mean that all are equal. Always try to use ID and Element as selector as they are very fast. Even the class selectors are slower than ID selector. Read more about jQuery selector.
- Use IDs instead of Classes as selector. Read here why?
- Always Minimize or Minify your JavaScript Code
- Always use the compressed version of jQuery. Read "Why to use compressed version of jQuery".
- Use CACHING to store selection so that it can be used later on. This will improve the performance.
- Just for the sake of completing the task, don't repeat your code as it increases the lines of code and reduces performance.
- Don't use jQuery unless it is not necessary.
Feel free to contact me for any help related to jQuery, I will gladly help you.
No comments:
Post a Comment