jquery-mobile-后退按钮双后退-仅限Android

问题描述:

与data-rel ="back"的链接会导致两次(两次)向后转换,而不是一次.这个问题似乎与Android有关-在2.2和2.3中得到了证明.

Link with data-rel="back" causes two (double) back transitions instead of a single. The issue seems to be Android related - demonstrated in 2.2 and 2.3.

第1页->第2页->第3页

page 1 -> page 2 -> page 3

如果用户单击第3页的后退链接,则会发生以下情况: 反向链接->(第2页温度)->第1页

If the user clicks the back link on page 3 the following will happen: back link -> (page 2 temp) -> page 1

尝试禁用pushStateEnabled失败

Attempted to disable pushStateEnabled without success

<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script>
$( window ).bind( 'mobileinit', function(){
    $.mobile.pushStateEnabled = false;
});
</script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>

也尝试过并保持双后退

<a href="/" onclick="history.back(-1)" >Back</a>

是否有任何建议/更新以提供预期的功能?

Any suggestions/update to deliver expected back functionality?

只要您的锚标记正确,我就不会理解为什么$.mobile.pushStateEnabled = false;无法正常工作.

As long as your anchor tags are correct I don't see why $.mobile.pushStateEnabled = false; does not work.

也许可以使用文档"代替窗口"作为选择器.

Maybe using 'document' as your selector instead of 'window' will do the trick.

您尝试了吗?

<script>
$( document ).bind( 'mobileinit', function(){
    $.mobile.pushStateEnabled = false;
});
</script>