开发者

Opening my JQTouch Iphone WebApp for the home icon, why every external link open in another safari window?

Using the JQTouch library, usely links like the following ... should open the new pag开发者_运维百科e in the SAME window. That works fine when I go to the site using Safari BUT when I launch the site from the home saved icon, it opens a fullscreen site and on the first link it opens a NEW Safari window. How can I make it stay in the same original fullscreen window?


You have to set the target to _webapp. E.g:

<li class="arrow"><a href="some_page.html" target="_webapp">Some Page</a></li>

and then it will load on the same page.


You need to look into manifest files.

The manifest file declares what files (html, javascript, css, jpgs etc.) that the iPhone should cache in order to make a webapp work offline. A part of the manifest file is used to declare which URLs are OK to use when in full screen (webapp) mode.

Specifically look at NETWORK in manifest files.

Example:

NETWORK:
*

This should allow access to any URL you like, and stay in webapp mode.

Alternatively use target="_self" - I haven't seen target="_webapp" anywhere.

/Mogens


One solution I found here is to change the way you write your links for a mobile app. Rather than a href='link.url' you'd write a href="javascript.window.location.href='link.url'"

Dislaimer: I haven't personally tried this yet, so I can't guarantee it will work. But logically, it does make sense.


Using target="_webapp" works only if you remove the rel="external", you cannot have both.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜