I want to do something like this:
$(document).on(\"pagebeforeshow\", \"#myPage\", function(event){
if(condition){
//I need to do something here to sto
Tested and working:
Index page
Second page
Third page
$(document).on('pagebeforechange', function(e, data){
var to = data.toPage;
var from = data.options.fromPage;
if (typeof to === 'string') {
var u = $.mobile.path.parseUrl(to);
to = u.hash || '#' + u.pathname.substring(1);
if (from) from = '#' + from.attr('id');
if (from === '#index' && to === '#second') {
e.preventDefault();
e.stopPropagation();
$.mobile.changePage( "#third");
}
}
});
http://jsfiddle.net/tronc/GPUay/3/