1

Using the JQTouch library, usely links like the following ... should open the new page 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?

1
  • could you post some code, including the an anchor tag with their ancestor elements? e.g. <ul><li><a href="...">a link</a></li></ul> Aug 20, 2010 at 13:10

4 Answers 4

1

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.

2
  • Looking for window.name, I didn't see anything like '_webapp' so it didn't work. But I liked the idea and I tried adding window.name = '_webapp' at the beginning of my page. It doesn't work when using fullscreen mode: it still opens a new Safari page.
    – Thithi32
    Aug 24, 2010 at 15:24
  • It has nothing to do with window.name, it is part of the underlying jqtouch code, when an anchor is clicked, jqtouch runs some code in the background which overrides the default behavior, adding _webapp is part of this. Oct 18, 2010 at 16:46
1

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

0

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.

1
  • I tried with href="#" onclick="window.location.href='link.url'", it worked BUT I had wierd JQTouch behaviour (my current user was getting disconnected, sometime the link didn't do nothing, ...) ... well I backed off for the moment.
    – Thithi32
    Aug 24, 2010 at 15:24
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.