views:

29

answers:

1

i have a set of web pages specifically designed to run on iPhones (using iUI for look). My problem is the back button. I have custom back navigation in my pages that act as i wish (i.e. one of those websites that say 'please do not use your browsers back buttons'. but id like to not do that if i don't have to). if the user hits the back button though things get messy. i suspect caching may be the problem, but my question is this:

can i modify the behavior of the back button in the iPhone browser by

A) disabling it altogether

B) somehow intercepting the event to make it do what i want (and already have defined in my custom back methods)

C) do something with caching so (if my suspicion is correct) back will always reload the previous page as if it were reached from a 'forward moving' click.

and if so, which of these options is best?

sorry for the vague question, but part of the problem is i don't know exactly how things are working or are supposed to work so its hard to be specific.

+1  A: 

I think you can add a "#" (hash) in the window.location (javascript) every time it loads a new page. So the back button will work.

felixlaumon
http://programming.top54u.com/post/Javascript-Location-Hash-with-Example.aspx FYI
felixlaumon