没有得到正确的结果在背压在jquery手机 [英] Not getting proper result on back press in jquery mobile

查看:148
本文介绍了没有得到正确的结果在背压在jquery手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有3个html文件作为

Hi I have 3 html files as

index.html

index.html

<!DOCTYPE html>

<html>

<head>

    <link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.css" />
    <link rel="stylesheet" href="docs/assets/css/jqm-docs.css" />
    <link rel="stylesheet" href="docsdemos-style-override.css" />


    <script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
    <script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
    <script type="text/javascript" charset="utf-8" src="js/main.js"></script>
    <script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.0.js"></script>

</head>

<body>

<div data-role="page" id="home">
    <div data-role="content">

        <a href="TestMenu.html" data-role="button" id="myButton">index</a>          

    </div>
</div>

</body>
</html>

现在点击按钮,我调用TestMenu.html,它是:

Now on click of button I call TestMenu.html which is as:

<!DOCTYPE html>

<html>

<body>

<div data-role="page" id="home">
    <div data-role="content">

        <a href="PortfolioTest.html" data-role="button" id="myButton">TestMenu</a>         

    </div>
</div>

</body>
</html>

点击按钮我调用PortfolioTest.html这是:

on click of button I call PortfolioTest.html which is as:

<!DOCTYPE html>

<html>

<body>

<div data-role="page" id="home">
    <div data-role="content">

        <a href="#" data-role="button" id="myButton">PortfolioTest</a>         

    </div>
</div>

</body>
</html>

现在当我回来时,然后上一个屏幕表示TestMenu.html显示,当我再次按下按钮在TestMenu .html它再次来到PortfolioTest.html riseil现在一切都很好但现在如果我回来,而不是去TestMenu.html它直接到index.html页。

Now when I back press then previous screen means TestMenu.html is displayed when I press button again in TestMenu.html it again comes to PortfolioTest.html uptil now everything is fine But now if I press back then instead of going to TestMenu.html it goes directly to index.html page.

这是所有当我使用Android版本2.2,如果我使用版本2.1,那么一切都很好。这是什么解决方案?任何帮助将不胜感激。提前感谢。

This is all when I use Android version 2.2 and if I use version 2.1 then everything is fine. What is the solution for this? Any help will be appreciated. Thanks in advance.

推荐答案

$。mobile.pushStateEnabled = false; 解决我的问题。现在它在所有版本中完美工作。

$.mobile.pushStateEnabled = false; solve my issue. Now it works perfectly in all version.

这篇关于没有得到正确的结果在背压在jquery手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆