localforage本地存储indexdb、websql、localstorage示例代码

代码语言:html

所属分类:其他

代码描述:localforage本地存储indexdb、websql、localstorage示例代码

代码标签: localforage 本地存储 indexdb websql localstorage 示例 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

  
  
  
<style>
.logList {
	margin-top: 20px;
	width: 250px;
	min-height: 200px;
	padding: 5px 15px;
	border: 5px solid #000;
	border-radius: 15px;
  margin: 10px 0 30px;
  list-style: none outside none;
}

.logList:before {
	content: 'log';
	padding: 0 5px;
	position: relative;
	top: -1.1em;
	background-color: #FFF;
}
</style>


  

  </head>
  <body>

    <ul id="htmlConsole" class="logList"></ul>
   <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/localforage.min.js"></script>

  
      <script >
      
  /*    localforage.config({
    driver      : localforage.WEBSQL, // Force WebSQL; same as using setDriver()
    name        : 'myApp',
    version     : 1.0,
    size        : 4980736, // Size of database, in bytes. WebSQL-only for now.
    storeName   : 'keyvaluepairs', // Should be alphanumeric, with underscores.
    description : 'some description'
});*/
// Feel free to change the drivers order :)
localforage.setDriver([
localforage.INDEXEDDB,
localforage.WEBSQL,
localforage.LOCALSTORAGE]).
then(function () {
  var key = 'STORE_KEY';
  // var value = 'What we save offline';
  var value = 'asdf';
  //value[.........完整代码请登录后点击上方下载按钮下载查看

网友评论0