javascript - What are some quick tips for increasing jQuery performance? -


What are some quick tips to increase jQuery performance?

  1. 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).
  2. Make your zodose objects as much as possible
  3. 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.
  4. Do not use $ each. , Use for this (;;) Instead it's ten times faster.

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -