Events = All the different visitor's actions that a web page can respond to.
You can use any standard jQuery events in jQuery Mobile.
In addition, jQuery Mobile also offers several events that are tailor-made for mobile-browsing:
For a complete reference of all the jQuery Mobile events, please go to our jQuery Mobile Events Reference.
In jQuery, you have learned to use the document ready event to prevent any jQuery code from running before the document is finished loading (is ready):
However, in jQuery Mobile, we use the pagecreate event, which occurs when the page has been been created in the DOM, but before enhancement is complete.
The second parameter ("#pageone") points to the id of the page to specify the event(s) for:
Note: The jQuery on() method is used to attach event handlers. |
The next chapters will explain some of the most popular events in jQuery Mobile.