2

My webapp is using angularjs-1.5.11 and we are using below line to go back in the application:

$window.history.go(-1)

This is not working in ios 10.2.1 I've tried the below, but didn't work

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

I saw other posts which suggests to disable hashListening but I'm not sure how to do this in angularjs.

Anyone has suggestions please.

CodeTweetie
  • 6,075
  • 3
  • 19
  • 23

2 Answers2

0

Try do it using jquery

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

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

  });

And also make sure that your files in this order

<script src="jquery.js"></script>
<script src="custom-scripting.js"></script> <!-- Note your script before jqm -->
<script src="jquery-mobile.js"></script>
Mr_Perfect
  • 8,254
  • 11
  • 35
  • 62
  • 1
    At the moment, my app is not using/having any jquery at all, so I'm little hesitant to include it. Will try it if nothing else works. Thanks for your suggestion. – CodeTweetie May 31 '17 at 11:12
-3

Use the below code

<button type="button" onclick="goBack()">Go To Back</button> 
Ved Rauniyar
  • 1,539
  • 14
  • 21