jQuery Mobile pageloadfailedEvent
Examples
Pop up a message when page loading fails:
alert("Sorry, the requested page does not exist.");
});
Try it Yourself »
Definition and Usage
Deprecated since version 1.4.0, usepagecontainerloadfailedinstead.
The pageloadfailed event is triggered when page loading fails.
Related events:
- pagebeforeload- Event triggered before any loading
- pageload- Triggered after the page is successfully loaded and inserted into the DOM.
Note:When an external page is loaded into the DOM, two types of events are certainly triggered: the pagebeforeload event before loading, and after loading, either pageload (successful load) or pageloadfailed (failed load).
Syntax
| Parameters | Description |
|---|---|
| function(event,data) | Required. Specifies the function to execute after the pageloadfailed event is triggered. The function contains the following two parameters: Event object- Includes any jQuery event properties (event.target, event.type, etc.). For more information, seejQuery Event Reference Manual Data object- Contains the following types:
|

More Examples
Related events demonstration.
Demonstration of the pageload and pageloadfailed events.
Event object
Use the event.type property to return the type of the triggered event.
Data object
Use data.url to return the URL of the page that failed to load.
Data object
When the page is not found, use data.errorThrown to return the error message.
Other extensions
jQuery Mobile Events