Git Product home page Git Product logo

webstoragewrapper's Introduction

WebStorage Wrapper

説明
  localStorageとsessionStorageを手軽に使える様にするラッパー
  jQuery依存

初期化
  dbname = new webStorage(localStorage or sessionStorage)

メソッド一覧
  .get('key') => WebStorageから指定した一件のvalueオブジェクトを取得する
  .getStr('key') => WebStorageから指定した一件のvalue文字列を取得する
  .set('key', value Object) => 指定したkey文字列とvalueオブジェクトをWebStorageにセットする
  .setStr('key', 'value') => 指定したkey文字列とvalue文字列をWebStorageにセットする
  .del('key') => WebStorageからkey文字列で指定した一件を削除
  .len() => WebStorageに登録されているデータの件数を整数値で取得
  .key(index) => index番目のデータからkeyを取得する(0から開始)
  .clear() => WebStorageの全件を削除
  .all(function) => WebStorageの値を一件ずつfunction('key', value Object){...}として実行する
  .find('keyword') => WebStorageの全データの中から、指定したkeyword文字列が含まれるvalue文字列を持つ全てのkey文字列を配列として返す
  .copyJ2D('ulr') => 指定したurlのJSONファイルを取得し、その内容をWebStorageに格納する
  .copyD2D() => もうひとつのWebStorageにコピーを作成する

使用例
  // localStorageの用意
  ldb = new webStorage(localStorage);

  // sessionStorageの用意
  sdb = new webStorage(sessionStorage);

  // localStorageにvalueオブジェクトを格納
  ldb.set('key1', valueObject);

  // sessionStorageにvalueテキストを格納
  sdb.setStr(key2', 'value2');

更新履歴
  2013/10/06 公開

webstoragewrapper's People

Watchers

ponko23 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.