English 中文(简体)
校外上网
原标题:Save webpages for offline access in web app

我有一个网站(sencha/phonegap),其中包括一个使用户能够点击连接Wikipedia的文章的纽芬兰语。 如果该装置有互联网接入,这显然会奏效,但我也接到许多要求,要求该仪器在离线时也投入使用。 为此,我要让用户选择下载相关文章/网页,以便上网。 如果该装置没有互联网接入,则该仪器将显示所节省的版本(可能停用/停用,但比任何情况都好)。 如何完成这项任务?

我首先想到的是,有人将“html”的标识用于打上电话浏览器的页面,这些浏览器在安伯瑟可能听起来,但“OS”显然有5个布罗伯尔轴线――太小。

我的下一个想法是拯救必要的“灯塔”和“灯塔”;相关档案和装在 app内。 但是,这种做法似乎过于繁琐,其使用量比需要大得多,而且网页的安装日期一直滞后。

利用javascript,是否可能下载网页,然后(例如,在纸上)可以节省网页,以便日后查阅?

Or is there a more elegant approach?

If anyone could point me in the right direction it would be much appreciated.

最佳回答

在纯 Java文中,你可以提出Ajax下载网页的请求。 然后,您可使用FileWriter将答复Text写到档案系统中的档案中。 然而,这在形象方面给你带来了帮助。 http://docs.phonegap.com/en/1.7.0/cordova_file_file.md.html#File Transfer_download”rel=“nofollow” 文件传输系统() 掌握双亲图像档案。

如果我是:

  1. Use AJAX to download the html.
  2. Parse the html looking for images.
  3. Use FileTransfer.download to get the images.
问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签