当我按下浏览器后退按钮时,我的对话框再次显示。我该如何防止这种情况?
HTML
<body>
<div data-role="page" id="page1">
<a href="#dialog" data-rel="dialog">click me</a>
....stuff...
</div>
<div data-dialog="true" data-role="dialog" id="dialog">
<a href="#" data-bind="click: function () { goToPage2() }">go to p2</a>
....stuff...
</div>
<div data-role="page" id="page2">
....stuff...
</div>
</body>
型号:
function UserViewModel() {
self.startEvacuation = function () {
$.mobile.navigate("#page2");
}
};