jQuery Mobile pagecontainerloadfailedEvent
Examples
Display a text message after the page is successfully loaded and inserted into the DOM:
alert("Sorry, the requested page does not exist.");
});
Try it Yourself »
Definition and Usage
The pagecontainerload event is triggered after the page is successfully loaded and inserted into the DOM.
Related events:
- pagecontainerbeforeload - Triggered before the load request
- pagecontainerload- Triggered after the page is successfully loaded and inserted into the DOM
Note:This event is used for external pages - after the page is loaded and inserted into the DOM, 2 events will be triggered. The first event is pagecontainerbeforeload, and the second event may be pagecontainerload or pagecontainerloadfailed.
Syntax
$("document").on("pagecontainerloadfailed",function(event,data){...})
| Parameter | Description |
|---|---|
| function(event,data) | Required. Specifies the function to execute after the event is triggered. This function has two optional parameters: event object- Contains jQuery event properties (e.g., event.target, event.type, etc.). SeejQuery Event Reference Manualfor more information. data object- Contains the following:
|
More Examples
Related Event Demos
Demonstrations of the pagecontainerload and pagecontainerloadfailed events.
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 address of the external page.
data object
Use data.errorThrown to return some information when the page does not exist.
jQuery Mobile Events