Book Image

jQuery Mobile Web Development Essentials - Third Edition

By : Raymond Camden, Andy Matthews
Book Image

jQuery Mobile Web Development Essentials - Third Edition

By: Raymond Camden, Andy Matthews

Overview of this book

jQuery Mobile is a HTML5-based touch-optimized web framework. jQuery Mobile can be used to build responsive cross-platform websites and apps for a wide range of smartphones, tablets, and desktop devices. The jQuery Mobile framework can be integrated with other mobile app frameworks such as PhoneGap, IBM Worklight, and more. Introduction to jQuery Mobile explains how to add the framework to your HTML pages to create rich, mobile-optimized web pages with minimal effort. You’ll learn how to use jQuery Mobile’s automatic enhancements and configure the framework for customized, powerful mobile-friendly websites. We then dig into forms, events, and styling. You'll see how jQuery Mobile automatically enhances content, and will find out how to use the JavaScript API to build complex sites. We’ll introduce you to how jQuery Mobile can be themed as well looking into how JavaScript can be used for deep sets of customizations. The examples are ready to run and can be used to help kick-start your own site. Along the way, you will leverage all the concepts you learn to build three sample mobile applications.
Table of Contents (20 chapters)
jQuery Mobile Web Development Essentials Third Edition
About the Authors
About the Reviewer

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:

  1. It helps our code stay organized and tidy.

  2. It prevents the variables and functions we write from being accidentally overwritten or altered by any other...