Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

no event before the page is loaded #2186

Closed
v3n3 opened this issue Aug 2, 2011 · 4 comments
Closed

no event before the page is loaded #2186

v3n3 opened this issue Aug 2, 2011 · 4 comments

Comments

@v3n3
Copy link

v3n3 commented Aug 2, 2011

it would be nice to have an event triggered before a page is loaded.

For example, it can be useful for unbinding listeners in the previous page (specially in case of a multi page data like product list) or add tracking. The main advantage of using such event rather than changepage is that you can use them when you load page in background (directly using $.mobile.loadpage()).

@ghost ghost assigned johnbender Aug 7, 2011
@toddparker
Copy link
Contributor

Could you add this issue to the feature request wiki page and link to here? We'll re-open it once we decide to work on it.

@v3n3
Copy link
Author

v3n3 commented Aug 8, 2011

it is, in feature request > navigation > "Event before the page is loaded", i did as we asked me when we discussed #2151 (comment)

@toddparker
Copy link
Contributor

Awesome, thanks!

@jblas
Copy link
Contributor

jblas commented Sep 28, 2011

@v3n3

Just an FYI, this landed on the HEAD. The events to listen for are pagebeforeload, pageload, and pageloadfailed. A data object is passed as the 2nd arg of a bound callback. The data for all 3 events contain an url and absUrl properties. The pageload event data contains an additional property that is the jQuery collection that contains the page that was just loaded and inserted into the DOM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants