Hi I have 3 html files as
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>
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>
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>
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.
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;solve my issue. Now it works perfectly in all version.