2

我的 webapp 正在使用 angularjs-1.5.11,我们使用下面的行返回应用程序:

$window.history.go(-1)

在 ios 10.2.1 中不起作用 我尝试了以下方法,但没有奏效

window.history.go(-1) 
history.back()
navigator.app.backHistory

我看到其他建议禁用 hashListening 的帖子,但我不确定如何在 angularjs 中执行此操作。

请任何人有建议。

4

2 回答 2

0

尝试使用jquery

  $(document).bind('mobileinit', function () {

      $.mobile.hashListeningEnabled = false;
      $.mobile.linkBindingEnabled = false;

  });

并确保您的文件按此顺序

<script src="jquery.js"></script>
<script src="custom-scripting.js"></script> <!-- Note your script before jqm -->
<script src="jquery-mobile.js"></script>
于 2017-05-31T11:07:00.793 回答
-3

使用下面的代码

<button type="button" onclick="goBack()">Go To Back</button> 
于 2017-05-31T11:16:16.630 回答