大家好,我來自一個HTML頁面導航到另一個:window.location的不正常工作
window.location = "test.html";
在test.html中我有標題爲:
<script type="application/javascript">
function redirect()
{
alert("inside redirect:");
//window.location = url;
//history.back();
history.go(-1);
return false;
}
</script>
<div data-role="navbar">
<ul>
<li> <a href="#" data-theme="b" onclick="history.back(); return false;">Go Back</a></li>
<li> <a onclick="redirect()" data-icon="back" data-iconpos="notext" data-direction="reverse" class="ui-btn-left jqm-home">Back1</a></li>
</ul>
</div>
但在這裏都後退按鈕(後退和後退1)不起作用。如果我使用$.mobile.changePage('test.html')
在頁面之間導航,那麼兩個「後退」按鈕都可以工作。爲什麼他們不與windows.location?
我想爲不支持ajax的B級瀏覽器開發此應用程序。所以我不能使用$.mobile.changePage('test.html')
。
任何幫助將不勝感激。謝謝。
你特別關注哪個移動設備和操作系統?黑莓OS 5? – 2012-07-26 07:14:29
是的。如果我使用window.location.assign(「first.html」);那麼它從test.html導航到first.html,但當我按下移動(硬件按鈕)的按鈕,然後再次導航到test.html – PPD 2012-07-26 08:18:49
$ .mobile.changePage('test.html')中的問題是什麼'它的工作原理非常好... – 2012-07-26 08:34:29