Easy Tutorial
❮ Jquerymobile Ref Icons Event Pagebeforeload ❯

jQuery Mobile Events


Event = The response actions for all different visitors accessing the page.


jQuery Mobile Events

In jQuery Mobile, you can use any standard jQuery events.

Additionally, jQuery Mobile provides events specifically for mobile browsers:


Initializing jQuery Mobile Events

When learning jQuery, we learned to use $(document).ready() to ensure your jQuery code scripts start executing after the DOM elements have loaded:

jQuery document ready event

However, in jQuery Mobile, use the pageinit event to set your code scripts to start executing after the DOM elements have loaded. This is necessary to execute scripts when any new page is loaded and created, so you need to bind the pageinit event.

The second parameter ("#pageone") specifies the page ID for the event:

jQuery Mobile pagecreate event

| | Note: The jQuery on() method is used to bind events to selected elements. | | --- | --- |

In the next section, we will discuss jQuery Mobile events in more detail.

❮ Jquerymobile Ref Icons Event Pagebeforeload ❯