I want to do something like this:
$(document).on(\"pagebeforeshow\", \"#myPage\", function(event){
if(condition){
//I need to do something here to sto
I know if I use "pagebeforechange" event it works fine, but i need doing it when the other page is loaded (but not shown). I've found a solution adding a new DIV element as a page DIV child, hiding and showing it:
HTML
...
JS
$(document).on("pagebeforeshow", "#myPage", function(){
$("#contentTarget1").hide();
if(condition){
$.mobile.changePage("#target2Page");
} else {
$('#contentTarget1').show();
...
}
});