javascript - What are some quick tips for increasing jQuery performance? -
What are some quick tips to increase jQuery performance?
- Prioritize the simple selection first with id only , and only Second by tag name . To select by the class name or the CSS selector, jQuery needs to run on the DOM, while the ID and the tag map are in the "native" browser DOM Functions (getElementById and getElementByTagName).
- Make your zodose objects as much as possible
- cache . Instead of choosing the elements individually, select a common ancestor element and use the
find
function to find the elements within the scope of those elements. It is actually only optimal if you are doing some operations on the general ancestor; Otherwise, to find and cache the ancestors, this could be more than the benefits of the Schodday traversal. - Do not use
$ each.
, Usefor this (;;)
Instead it's ten times faster.
Comments
Post a Comment