Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 4: Using PhoneGap with jQuery Mo... > PhoneGap jQueryMobile Integration

PhoneGap jQueryMobile Integration

Now that you understand how jQueryMobile works, let's work on integrating the features of PhoneGap and jQueryMobile to create applications.

Please note when you are using jQueryMobile with PhoneGap, there are three JavaScript frameworks, each bootstrapping on their own.

  1. PhoneGap framework
  2. jQuery framework
  3. jQueryMobile framework

While all the frameworks provide their own bootstrap mechanism, it is best to bootstrap these frameworks in the following order:

  1. PhoneGap
  2. jQuery
  3. jQueryMobile (if really required).

This is shown in the following example:

<script>

    //onDeviceReady is called when PhoneGap is initialized

    function onDeviceReady() {
        $(document).ready(function() {
            //Call any jQuery functions here
        });
    }
    document.addEventListener(deviceready, onDeviceReady);
</script>

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial