O'Reilly logo

jQuery Mobile Cookbook by Chetan K Jain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Page load and remove events

The jQuery Mobile framework triggers the page load events whenever an external page is loaded into the DOM. It fires the pagebeforeload event before loading the page and then fires either the pageload or pageloadfailed event based on the status of the page load. The pageremove event is fired when a page is removed from the DOM. This recipe shows you how to use the page load and page remove events.

Getting ready

Copy the full code of this recipe from the code/08/pageload sources folder. You can launch this code using the URL http://localhost:8080/08/pageload/main.html.

How to do it...

Carry out the following steps:

  1. Create main.html with four buttons and an empty div element, as shown in the following code snippet:
    <div ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required