You can debug mobile safari, but unfortunately you need a mac.
If not, try this:
- Make sure your code is working and no errors on desktop safari;
- Check if you are actually making the call by adding an
alert("history() called")
in place of the history(-1)
code;
- Is it in a link that has a default behavour to navigate to another page? If so, you need a
event.preventDefault()
or at least a return false;
after the history() call.