You can get the page from which the user enters the data
object:
$(document).bind("pagebeforechange", function ( event , data ) { console.log(data.options.fromPage.attr('data-url')); });β
Note that since you are attached to the document
element, and not to one data-role="page"
element, which will fire twice for each page change, once for fromPage
and once for toPage
. The data passed to the event handler for each page event will be the same as the data for another page.
Here is a demo: http://jsfiddle.net/Atfrf/2/
source share