有没有办法刷新你的phonegap应用程序 - 例如,构建的页面,并开始从一开始运行脚本? [英] Is there a way to refresh your phonegap application - eg, build the page and start running the scripts from the beginning?

查看:131
本文介绍了有没有办法刷新你的phonegap应用程序 - 例如,构建的页面,并开始从一开始运行脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有办法吗?

例如,如果用户没有互联网连接启动应用程序,则不能加载远程脚本,无法运行,我显示无互联网页面。但是如果用户稍后获得互联网并且应用程序仍在运行,是否有任何方法只是重新启动?

E.g., if a user starts the app with no internet connection, no remote scripts can be loaded, and the application basically can't run and I display a "No internet" page. But if the user gets internet later and the application is still running, is there any way to just "restart" ?

推荐答案

约 -

document.location = "index.html"

PhoneGap应用程序就像一个嵌入式网站 - 你应该可以去任何你想要的超链接(白名单)。

PhoneGap applications are just like an embedded website - you should be able to go to any hyperlink you wish (mind the whitelists).

当然,如果你还想检测什么时候再次在线,你应该使用PhoneGap网络API绑定到那些在线/离线事件。

Of course, if you also want to detect when it's again online, you should use the PhoneGap Network API to bind to those online/offline events.

一般来说,你曾经想过使用HTML5清单功能,让你的本地PhoneGap应用程序缓存这些远程脚本吗?这样你的应用程序仍然可以运行,即使在离线(除非它需要远程数据来做你的事)...

In general thought, have you ever thought of using the HTML5 manifest functionality to actually let your local PhoneGap app cache those remote scripts? That way your app could still run, even when offline (except if it needs remote data to "do your thing")...

希望这有助于!

这篇关于有没有办法刷新你的phonegap应用程序 - 例如,构建的页面,并开始从一开始运行脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆