Book Image

Creating Mobile Apps with jQuery Mobile - Second Edition

By : Andy Matthews, Shane Gliser
Book Image

Creating Mobile Apps with jQuery Mobile - Second Edition

By: Andy Matthews, Shane Gliser

Overview of this book

<p>jQuery Mobile is a mobile-centric web framework developed by the jQuery team. The project focuses on building a framework compatible with the ever-increasing variety of smartphones and tablet computers on the market. The jQuery Mobile framework plays well with other frameworks and platforms, such as PhoneGap and Backbone.</p> <p>Automate repetitive tasks easily and painlessly with the Grunt task runner, build a fully responsive, gorgeous photography website, and learn how to mix and match jQuery Mobile 1.4.5 into existing websites and how to deploy those changes to content management systems such as WordPress, Drupal, and HarpJS. jQuery Mobile aims to reach everyone, and so does this book. It will enhance your mobile knowledge and help you to create versatile, unique sites quickly and easily.</p>
Table of Contents (18 chapters)
Creating Mobile Apps with jQuery Mobile Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Breaking the HTML into a server-side template


Normally, I'm a Java guy, but I've chosen Hypertext Preprocessor (PHP) due to the prevalence of the Linux, Apache, MySQL, PHP (LAMP) platform. All we're really doing here is using variables and Server Side Includes to give our templates consistency and flexibility.

Let's break down the initial HTML into a nice PHP boilerplate. If you want to save this to a file for now, may I suggest the /boilerplate.php file:

<?php
    /* the document title in the <head> */
    $documentTitle = "jQuery Mobile PHP Boilerplate";

    /* Left link of the header bar       
     *   
     * NOTE: If you set $headerLeftLinkText = 'Back' then it will become a
       back button, in which case, no other field for $headerLeft need be defined.    
     */     
    $headerLeftHref = "/";
    $headerLeftLinkText = "Home";
    $headerLeftIcon = "home";

    /* The title text which shows up in the header bar */
    $headerTitle = "Boilerplate";
 
    /* Right link...