Writing Effective jQuery Code
WHAT’S IN THIS CHAPTER?
- The $.data() Method
Now that you’ve walked through the breadth of what jQuery has to offer, it’s time to look at some specific ways in which you can improve your jQuery code.
In this chapter, you learn a variety of techniques, best practices, and patterns that you can apply to your code immediately to make it more efficient, maintainable, and clear.
You also learn about common jQuery patterns and how best to use them to create maintainable, clear code for use in projects of all shapes and sizes.
Finally, you are introduced to the jQuery $.data() method, which enables you to store and retrieve application data in a clear, standardized way.
After reading this chapter, your code will be faster and your coworkers will applaud you for your code organization.
Be warned — once you start to pay strict attention to performance, it can infect all of your coding.
Your users will love you.
Minimize DOM Updates
One of the most fundamental ...