jQuery Mobile pageloadfailed event
Examples
Failed pop-up message when the page loads:
alert("抱歉,请求的页面不存在。");
});
try it"
Definition and Usage
After the 1.4.0 version is obsolete, use pagecontainerloadfailed instead.
pageloadfailed event is triggered when the page failed to load.
Related events:
- pagebeforeload - prior to any loading event triggered
- pageLoad - triggered after the page has successfully loaded and inserted into the DOM.
Note: The external page is loaded into the DOM, the event will certainly trigger type 2. Before loading the pagebeforeload event, and after loading pageload (loaded successfully) or pageloadfailed (failed to load).
grammar
参数 | 描述 |
---|---|
function(event,data) | 必须。指定 pageloadfailed 事件触发后执行的函数。
该函数含有以下两个参数: 事件对象 - 包括任何jQuery事件属性 ( event.target, event.type 等) 。更多信息请查阅 jQuery 事件参考手册 数据对象 - 包含以下类型:
|
More examples
Related events demonstrate.
pageload and presentation pageloadfailed events.
Event objects
Use event.type property to return the type of trigger event.
Data Objects
Use data.url return URL is not successfully loaded the page.
Data Objects
When the page is not found, use data.errorThrown returns an error message.