JQuery Mobile, redirecting by window.location prevents pageshow event
问题 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? 回答1: When you use window.location or