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
  • PrintPrint
Share this Page URL
Help

Chapter 4: Using PhoneGap with jQuery Mobile > Getting Acquainted with jQuery

Getting Acquainted with jQuery

jQuery is one of the best JavaScript libraries that help you do Ajax calls, search the HTML DOM for a particular element, and modify the DOM. It also has its own plug-in framework. The best thing is its cross-browser framework, taking the headache out of browser differences. You can refer to the following jQuery tutorial: www.w3schools.com/jquery/default.asp.

jQuery Initialization

jQuery initialization is a two-step process.

  1. Include jQuery JavaScript in your HTML page.
  2. Declare a callback, which will be called by jQuery when jQuery’s library is loaded.

This is necessary as an HTML page may include many files like CSS, JavaScript, and images. The browser would download all these resources and start executing all the JavaScript blocks. If you start to use jQuery API calls before proper initialization, you will get errors. Therefore, you declare a callback, which is an entry point for our application, and jQuery will call this callback and bootstrap the application.


  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint