HTML5 offline apps and caches

Source: Internet
Author: User

1 Localstorage and Sessionstorage

Sessionstrage:session that is the meaning of the session, where a user browsing a website, from the site to close the site this time period, the session object is only so long. Localstorage: Save the data on the client hardware device, no matter what it is, it means that the data will be there the next time you turn on the computer. The difference is a temporary save, a possession for a long term.
2 Local Database
using the Sqllite database requires two necessary steps: Create a database Access object to create objects using transactions: OpenDatabase (DbName, version, Dbdesc, size) actual access: Db.transaction ( function () {tx.excutesql ('create Table ... ' );}); Data query: Excutesql (SQL, [], DataHandler, ErrorHandler)// back two for callback function; [] estimated to be SQL injection processing

3 manifest file

1 Recommended name suffix named. appcache

<! DOCTYPE html>

  

  

2 web-inf/Web. xml file is  set. <mime-mapping>    <extension>appcache</extension>    <mime-type>text/cache-manifest </mime-type>  
3 Demo.appcache as follows

/current project name/
/current project name/
4 The first visit of the viewer will automatically print the cache log



 

HTML5 offline apps and caches

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.