So I'm trying to redirect the user back one level in the history on an iPhone HomeScreen App, but it's simply just not firing for some reason.
Current code is as follows window.history.go(-1)
I've also tried various other version window.history.back()
, history.go(-1)
, but no luck yet. I can't wrap my head around how to implement the pushState, so I haven't tried that approach yet, but it's quite annoying how incredibly bad the homescreen app stuff is made.
Atleast you're able to debug with Safari.
You can debug mobile safari, but unfortunately you need a mac.
If not, try this:
alert("history() called")
in place of the history(-1)
code;event.preventDefault()
or at least a return false;
after the history() call. Try something like:
<a href="javascript:history.go(-1)">Go back</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With