jQuery Mobile pagecontainerloadfailed event
Example
Pop up a text message after the page is successfully loaded and inserted into the DOM:
$(document).on("pagecontainerloadfailed",function(){
alert("Sorry, the requested page does not exist.");
});
Try it »
Definition and Usage
The pagecontainerload event is triggered after a page is successfully loaded and inserted into the DOM.
Related events:
- [pagecontainerbeforeload ](event-pagecontainerbeforeload .html) - Triggered before a request is loaded
- pagecontainerload - Triggered after a page is successfully loaded and inserted into the DOM
**Note:** This event is for external pages - after a page is loaded and inserted into the DOM, 2 events are triggered. The first is pagecontainerbeforeload, and the second may be pagecontainerload or pagecontainerloadfailed.
Syntax
$("document").on("pagecontainerloadfailed",function(event,data){...})
| Parameters | 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 (such as event.target, event.type, etc.), see jQuery event reference manual for more information. data object - Contains the following: |
More examples
Related events demonstration
pagecontainerload and pagecontainerloadfailed event demo.
event object
Use the event.type property to return the type of event triggered.
data object
Use data.url to return the URL of the external page.
data object
Use data.errorThrown to return some information when a page does not exist.
jQuery Mobile Events