Posts

Showing posts with the label Performance

Iframe loading techniques and performance

Iframes are used to display a web page within a web page, load third party content, ads and widgets. The main reason to use the iframe technique is that the iframe content can load in parallel with the main page: it doesn't block the main page. There are two drawbacks in using iframe, Iframes block onload of the main page The main page and iframe share the same connection pool  The onload blocking is the biggest problem of the two and hurts performance the most. You really want the load event to fire as soon as possible. Here we will see different ways to load the iframe. Normal Iframe You all know this one. It's the default way to load an iframe and works in all browsers: <iframe src="/path/to/file" frameborder="0" width="728" height="90" scrolling="auto"> </iframe> Using the Normal Iframe technique will result in the following behaviour in all browsers: Iframe starts l...

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 ...