jQuery Mobile pageload event
Example
Pop up a message after an external page is successfully loaded and inserted into the DOM:
$(document).on("pageload",function(){
alert("pageload event triggered!");
});
Try it »
Definition and Usage
Deprecated after version 1.4.0, use pagecontainerload as a replacement.
The pageload event is triggered after a page is successfully loaded and inserted into the DOM.
Related events:
- pagebeforeload - An event triggered before any loading
- pageloadfailed - Triggered after a page fails to load.
Note: When an external page is loaded into the DOM, two types of events are definitely triggered: the pagebeforeload event before loading, and pageload (load succeeded) or pageloadfailed (load failed) after loading.
Syntax
$("document").on("pageload",function(event,data){...})
| Parameters | Description |
|---|---|
| function(event,data) | Specifies the function to execute after the pageload event is triggered
This function contains the following two parameters: Event Object - Includes any jQuery event properties (event.target, event.type, etc.). For more information, refer to the jQuery event reference manual Data object - Contains the following types: |
More examples
Related events demonstration.
pageload and pageloadfailed event demo.
Event Object
Use the event.type property to return the type of event that was triggered.
Data object
Use data.url to return the URL of the external page.
jQuery Mobile Events