1

I am using PhoneGap to develop an application for Android and iOS, and recently in a discussion about this technology, someone told me a seemingly brilliant idea that I can do background updates of my application without having to submit a new application to the app store.

The problem is that, being that I am still fairly new to the HTML5/CSS and Javascript world, I cannot figure out how to download files to my www directory for permanent storage. I can dynamically load JS code or HTML pages at runtime, but I want to create some javascript module that will find that a certain .css, .html, or .js file is out of date, download the new version of that file from some http or file server to the www directory, and then have that new file permanently saved so that it is available the next time the app is opened.

I feel like this should be simple, but I can't figure out how to do it. Thanks in advance.

4

1 回答 1

1

为了将文件永久保存到设备,您需要使用PhoneGap 文件 API。周期性任务可以通过一个简单的 Javascript 计时器来完成。

于 2013-04-24T05:34:45.037 回答