jQuery Mobile pagebeforeload event
Examples
Before loading request pop-up message:
alert("pagebeforeload 事件触发!");
});
try it"
Definition and Usage
pagebeforeload event is triggered before any load.
Related events:
- pageLoad - successfully loaded and inserted into the DOM trigger page.
- pageloadfailed - it triggered after the page failed to load.
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
parameter | description |
---|---|
function (event, data) | have to. Function is executed pagebeforeload specified event triggers. This function includes the following two parameters: Event objects - including any jQuery event properties (event.target, event.type etc.). For more information, please refer jQuery Event Manual Data Objects - contains the following types:
|
More examples
Related events Demo
This example demonstrates the pageload and pageloadfailed.
Event objects
Use event.type property to return the type of trigger event.
Data Objects
Use data.url return external URL of the page.