I have a JQuery Mobile application with many pages linked to each other. If I put a link on page A and set the href to page B, this script works fine:
$(document).on('pageshow','#pageB',function(){
alert('hello!');
});
But if I put a button on page A and write this code for onclick event:
window.location="pageB.html";
The pageshow event won't raise anymore! Where's the problem? How can I use window.location and still be able to catch the pageshow event?