-2

Creating a nice little phonegap build for ios at the moment, runs fine in the browser, however, when I compile it in Xcode and run in the simulator the history.back() I'm using doesn't work.

I need the history.back() in order to create a back button on each page in the app.

Does anyone know why this may be the case, or an alternative solution.

More information: phonegap build using ember js

Chris
  • 3,004
  • 3
  • 21
  • 26
  • Probably you need something like [this](http://stackoverflow.com/a/16589826/245679). – MD Sayem Ahmed Nov 21 '13 at 08:43
  • 1
    possible duplicate of [Phonegap - navigator.app.backHistory() not working on HTML back button](http://stackoverflow.com/questions/16542118/phonegap-navigator-app-backhistory-not-working-on-html-back-button) – MD Sayem Ahmed Nov 21 '13 at 08:44

1 Answers1

1

Yes, exactly. In several version iOS, Android ( old), history.back() seem not working. To fix it, you should try this code ( i find it in JQM @@ and it working well for all )

            var nav = window.navigator;
            if( this.phonegapNavigationEnabled &&
                nav &&
                nav.app &&
                nav.app.backHistory ){
                nav.app.backHistory();
            } else {
                window.history.back();
            }
Hanh Le
  • 894
  • 6
  • 14