Book Image

Mastering jQuery

By : Alex Libby
Book Image

Mastering jQuery

By: Alex Libby

Overview of this book

<p>Mastering jQuery has been written not only to help maximize your skills with core functionality in the library, but also to explore some of the more intriguing ways of using the library to achieve real-world solutions that could feature on any website or online environment.</p> <p>You'll start with a look at some of the more advanced ways to incorporate the library into your pages, followed by working with forms and advanced form validation using regular expressions. Next you'll move on to animating in jQuery, advanced event handling, and using jQuery effects.</p> <p>Finally, you will develop practical examples of using jQuery with external functionality such as node-webkit, before finishing with a session on optimizing your version of the library for maximum efficiency and exploring best practices for using QUnit.</p>
Table of Contents (21 chapters)
Mastering jQuery
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 3. Organizing Your Code

To organize or not organize, that's the question…

In our journey so far, we've covered the various means of downloading jQuery and seen how we can override core functionality with custom code, but—to misquote that famous detective: how should we organize our code?

Okay, you might think I'm losing the plot here, but bear with me on this; mastering a language such as jQuery is not just about producing complex code but about producing code that is well structured, concise, and clear to read.

In this chapter, we're going back to the basics with an introduction to some of the design patterns that are available within jQuery. We'll see how some of the techniques discussed in this chapter will help improve your code formatting and make you a better coder. In this chapter, we'll cover the following topics:

  • Introducing design patterns and why we should use them

  • Dissecting the structure of a design pattern

  • Exploring some examples of the different design patterns available...