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.

4

2 回答 2

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.

于 2012-04-09T14:23:10.857 回答
-1

Are you using phonegap or something similar?

In phonegap I use

navigator.app.exitApp();

and it works nice

于 2012-04-09T14:19:29.303 回答