I am building an iPhone开发者_Python百科 optimized website and when people use the '+' button on the iPhone you can add a bookmark to the website on the homescreen of the iPhone. How can I specify a url that will be used instead of the page they are on.
For example, if they are in the /Foo/Bar url I want the bookmark to be /Home so they go automatic to the home url and not go from their homescreen button straight deep in the site.
Is there some way to achieve this, in stead of making the whole website ajax based so there is only 1 url.
You can update the window.history
record on page load for any page that you want saved (which may be all your pages).
window.history.replaceState( '', '', '/Home' );
精彩评论