开发者

Specify an url in html for the bookmark option on the iPhone

开发者 https://www.devze.com 2023-01-06 13:48 出处:网络
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

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' );
0

精彩评论

暂无评论...
验证码 换一张
取 消