离线缓存

<!DOCTYPE html> 
<html manifest="tetris.manifest"> <!--在HTML标签里manifest=”cache.manifest”属性是告诉浏览器我们需要缓存那些文件。-->
    <head> 
        <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/> 
        <meta name="apple-mobile-web-app-capable" content="yes" /> <!--apple-mobile-web-app-capable: 这是又一个地方告诉浏览器,它一个离线应用程序-->
        <meta name="apple-mobile-web-app-status-bar-style" content="black" /> <!--apple-mobile-web-app-status-bar-style:当处于离线时隐藏状态栏和导航栏。-->
        <link rel="apple-touch-icon" href="iphon_tetris_icon.png"/><!--apple-touch-icon:告诉浏览器程序图标的地址。-->
         <link rel="apple-touch-startup-image" href="startup.png" /><!--apple-touch-startup-image: 告诉浏览器启动画面的地址。-->
         <link rel="stylesheet" href="css/tetris.css" type="text/css" media="screen, mobile" title="main" charset="utf-8"><!--还有一点请注意,最好把CSS文件放在上面,JavaScript文件放在下面。-->
        <title>offline Tetris</title> 

    </head> 
    <body><!--Put your Markup Here-->
        <script type="text/javascript" src="css/tetris.js"></script>

    </body> 

</html>
try 
{
//执行的代码,其中可能有异常。一旦发现异常,则立即跳到catch执行。否则不会执行catch里面的内容
}
catch
{
//除非try里面执行代码发生了异常,否则这里的代码不会执行
}
finally
{
//不管什么情况都会执行,包括try catch 里面用了return ,可以理解为只要执行了try或者catch,就一定会执行 finally
}
  CACHE MANIFEST
   
  # Version 3
   
  tetris.css
  index.html
  tetris.js
   
  # offline icons
  startup.png
  iphone_tetris_icon.png
原文地址:https://www.cnblogs.com/aimyfly/p/3164875.html