August 2013
Beginner
70 pages
1h 26m
English
In this recipe, we'll see how we can store a collection of previously selected elements in a variable for a later processing and how this method can improve performance.
This time our goal will be a little different. Instead of applying margins or borders, we'll perform a comparison to show how in a (simulation of a) real-world page, caching objects can significantly improve performance. In order to understand the explanation, follow these steps:
template.html file and rename it as reusing-elements.html.<head> section of the page adding this code:<script> $(document).ready(function() { var start = new Date(); var $description = $('.description'); ...Read now
Unlock full access