假设我在 example.com 上有一个网站
它包含两个本地视图,“数据库”和“年份”
最初,加载数据库视图。
用户导航到“年”视图。
地址栏(至少在 android 2.3 中)现在显示为 example.com#Year
然后用户决定出于任何原因刷新页面。
地址 example.com#Year 被刷新,用户会看到一个空白的白色屏幕。
有人对如何处理这种情况有任何建议吗?显然,无论用户在哪个视图,如果刷新,我希望它显示..
谢谢!
更新:
这是一些有助于描述我的问题的代码:
html:
<div data-role="view" id="Database">
<div data-role="content">
<p><strong>This is the Database view</strong></p>
<a data-role="button" id="databaseButton" href="#Year">Go to Year View</a>
</div>
</div>
<div data-role="view" id="Year">
<div data-role="content">
<p><strong>This is the Year view</strong></p>
<a data-role="button" id="yearButton">Refresh Page</a>
</div>
</div>
脚本:
var app = new kendo.mobile.Application($(document).body, {
initial: "Database"
});
$("#yearButton").click(function() {
// location.reaload();
// cannot simulate page refresh by the user in jsfiddle
// the current browser address is example.com/index.html#Year
// reloading this address produces a blank white screen
// because of the #Year parameter
});