Latest web development tutorials

jQuery Mobile pagecontainerbeforeload event

jQuery Mobile Events jQuery Mobile Events

Examples

Before requesting loaded pop-up message:

$ (Document) .on ( "pagecontainerbeforeload", function () {
alert ( "pagecontainerbeforeload event trigger!");
});

try it"

Definition and Usage

pagecontainerbeforeload event fires before requesting loaded.

Related events:

Note: This event is used for external page - a page is loaded and inserted into the DOM, 2 events will be triggered. The first event is pagecontainerbeforeload, the second event may be pagecontainerload or pagecontainerloadfailed.


grammar

$("document").on("pagecontainerbeforeload",function(event,data){...})
parameter description
function (event, data) have to. Specifies the event is triggered after the execution.

This function has two optional parameters:

event object - it contains jQuery event properties (eg: event.target, event.type, etc.), See jQuery Events Reference Manual for more information.

data Object - contains the following:

  • url (string) - absolute or relative URL address of the page (sent to $ .mobile.loadPage ())
  • absolute path of the URL - absUrl (string)
  • dataUrl (string) - the browser corresponding URL address
  • deferred (object) - contains the resolve () or reject ()
  • options (object) - Optional be sent to $ .mobile.loadPage ()
Note: In the event object you can manually process the request by calling the event.preventDefault (), data objects deferred object contains resolve () or reject () method.
Examples

More examples

Related events Demo
pagecontainerload and pagecontainerloadfailed event instances.

event objects
Use event.type property to return the type of trigger event.

data objects
Use data.url return URL address of the external page.