Adding functionality with JavaScript
As it is mentioned in this book, you don't need to write any JavaScript to get your money's worth from jQuery Mobile. But as you begin progressing in your experience with jQuery Mobile, you'll begin seeing how much additional value JavaScript can add to your projects. Before we look at the code, let's talk about how it will be structured. If you've done any web designing or development at all, you've probably seen JavaScript. It has been around since 1995 after all. The problem is that there are many different ways to do the same thing in JavaScript and not all of them are good.
The JavaScript code in this application will use what's called a design pattern. It's just a fancy term that specifies a certain structure for the code. There are three main reasons for using an existing design pattern are as follows:
- It helps our code stay organized and tidy.
- It prevents the variables and functions we write from being accidentally...