更改页面后未触发页面显示 [英] Pageshow not triggered after changepage
本文介绍了更改页面后未触发页面显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 jQuery Mobile,我想在用户单击主页上的按钮后将浏览器重定向到另一个页面.为此,我写道:
$.mobile.changePage("album-search-results.html",{数据:{区域:搜索区域,值:搜索值},过渡:流行"});
而且它工作正常,它加载了正确的页面,甚至在 URL 上放置了正确的值.不幸的是,pageshow 事件没有被触发:
<头><meta name="viewport" content="width=device-width, initial-scale=1"><script src="http://code.jquery.com/jquery-1.8.2.min.js"></script><script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script><link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css"/>头部><身体><div data-role = "page" data-theme = "d" id = "SearchResults"><div data-role = "header"><h1>聚合器</h1>
<div data-role = "content">
<script type="text/javascript">$("#SearchResults").on("pageshow",function(event, ui){控制台日志(ui.prevPage);});