Posts

Showing posts with the label Tips

jQuery 11 Performance Tips

jQuery 11 Performance Tips: Be remember the following tips for increasing the performance by reducing the work the browser has to do. 1.     Always Descend From an #id 2.     Use Tags Before Classes 3.     Cache jQuery Objects 4.     Harness the Power of Chaining 5.     Use Sub-queries 6.     Limit Direct DOM Manipulation 7.     Leverage Event Delegation (a.k.a. Event Bubbling) 8.     Eliminate Query Waste 9.     Defer to $(window).load 10. Compress Your JS 11. Learn the Library     1.      Always Descend From an #id The fastest selector in jQuery is the ID selector ( $('#someid')). This is because it maps directly to a native JavaScript method, getElementById(). < div id ="MyDivID">   < form method ="post" action ="/">   < h2 > Traffic ...