Tuesday, 14 November 2017

Exploring Offline Web Applications Using manifest attribute In HTML5

An offline Web application is an application that can work without a network connection. It allows the application cache to store resources that are used by the browser when it is offline. The application cache is controlled by a plain text file which is called manifest. A manifest file contains a list of resources to be used when there is no network connectivity. An Example of a manifest file is given as follows:

CACHE MANIFEST         #This is a
commentCACHE:/css/screen.css/css/offline.css/js/screen.js/img/logo.pnghttp://example.com/css/styles.cssFALLBACK:/ /offline.htmlNETWOK:*An example
application cache manifest file    

In the preceding example the first line CACHE MANIFEST tells the browser that this is a manifest file and the comments are prefixed by a hash(#).
A manifest file contains the following sections:

  • CACHE:- Specifies a list of files and resources that the browser needs to store or cache.
  • FALLBACK:- Specifies a list of files that are required to be mapped with an application when the browser has no online access.
  • NETWORK:- Specifies the resource that are available online.
We can provide the reference of a manifest file on a Webpage by adding the manifest attributes in the <HTML> tag 

like:
<!doctype html>
<html lang="en" manifest="/offline.manifest">
....
...
</html>
In this code the manifest attribute is used in the <HTML>tag to provide the reference of a manifest file, offline.manifest.

      

No comments:

Post a Comment