Coder Social home page Coder Social logo

store's Introduction

store

使用

  • browser: window.Store
<!--在head引入store.js-->
<script src="./store.js"></script>
<script>
  //for cookie
  var cookieStore = new Store('cookie');
  //for sessionStorage
  var sessionStore = new Store('session');
  //for localStorage
  var localStore = new Store('local');
</script>

方法

getData(list)

获取项的集合,list是key的集合

getItem(key)

获取项

getAllItem()

获取所有项

setData(data[, option])

设置,data是key-value对象,如果是cookieStore,提供了可选的option参数

setItem(key, value[, option])

设置项,如果是cookieStore,提供了可选的option参数

  • option
    • expires
    • path
    • domain
    • secure

removeItem(key)

移除项

clearAll()

移除所有项

store's People

Contributors

xiaobxia avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.