1

After searching Stackoverflow and Google, I have not found a working solution.

I need a web app to remain in standalone mode when changing pages (clicking links). Currently, when any links are clicked while in standalone mode, they are launched in a new window in Safari, and exits standalone mode.

How can I prevent links from opening a new window so that it remains in standalone mode.

This piece of code is tested and does not work:

$('a').click(function(e){
    e.preventDefault();
    window.location = $(this).attr('href');
});

It seems as though this is being circumvented by Safari while in standalone mode, preventing this from working. Is there a new work-around?

This app is being presented tomorrow, so PhoneGap is not an option; are there any others?

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
AVProgrammer
  • 1,344
  • 2
  • 20
  • 40

1 Answers1

1

I think you need to add return false; in your click closure.

Check out this post, iPhone Safari Web App opens links in new window

Community
  • 1
  • 1
Chris Wagner
  • 20,773
  • 8
  • 74
  • 95