jqueryjquery-mobilewindow-load

Alternative for window load for JqMobile


Is their any alternative for window load event for jquery mobile..??

$(window).load(function(){
// Code Here
}

Solution

  • I would look into the jQM Documentation for specific page loading events as there could be a couple that would work for you depending on what functionality, callbacks, etc...

    I would think you're looking for pagechange

    This event is triggered after the changePage() request has finished loading the page into the DOM and all page transition animations have completed. Note that any pageshow or pagehide events will have fired BEFORE this event is triggered. Callbacks for this particular event will be passed a data object as the 2nd arg. The properties for this object are as follows:

    • toPage (object or string) This property represents the page the caller wishes to make active. It can be either a jQuery collection
      object containing the page DOM element, or an absolute/relative url
      to an internal or external page. The value exactly matches the 1st
      arg to the changePage() call that triggered the event.
    • options (object) This object contains the configuration options to be used for the current changePage() call.

    Also I would read the methods page as well