2

I am running an HTML5 (+ CSS3 and JavaScript) app in mobile Safari on the iPad. The following meta tag in my HTML file lets the app run full screen when started using an icon on the iPad's home screen:

<meta name="apple-mobile-web-app-capable" content="yes" />

In the main menu of my app there is a 'close' option. Does anyone know whether I can attach a JavaScript handler to that option that closes the Safari browser (which hopefully will also make the user return to the home screen?) The trivial JavaScript command 'window.close()' does not work.

Jeroen
  • 839
  • 13
  • 20
  • iOS doesn't have a 'close' concept with its apps. You don't 'close' apps in iOS. You just switch to a different one. – DA. Apr 09 '12 at 14:24

2 Answers2

2

No. iOS applications don't have internal quit functions. Other than launching a different application from inside the app, only the home button will leave an application on that platform.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
-1

Are you using phonegap or something similar?

In phonegap I use

navigator.app.exitApp();

and it works nice

Víctor
  • 3,029
  • 3
  • 28
  • 43
  • 1
    Really? I've never see any iOS application with a self-quit function, and [this forum](http://comments.gmane.org/gmane.comp.handhelds.phonegap/22620) claims that that code doesn't work on iOS. – Quentin Apr 09 '12 at 14:22