浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

jQuery.localStorage() - jQuery SDK API

jQuery.localStorage()

From jQuery SDK API

 
Jump to: navigation, search
Categories: Data

Contents:

jQuery.localStorage( key )Returns: Object

Description: Get a value from the local storage.

Plugin: jQuery.storage

  • jQuery.localStorage( key )

    version added: 1.0

    key   A key of a stored value.

The jQuery.localStorage() method uses the native localStorage, if the localStorage object not available, the storage will be handled with cookies as fall back method.

  • Get a value from the local storage.

    Javascript:
    $.localStorage( 'foo', {data:'bar'} );
    
    $.localStorage( 'foo' );
    Results:
    {data:'bar'}

jQuery.localStorage( key, value )

Description: Set a value to the local storage.

Plugin: jQuery.storage

  • jQuery.localStorage( key, value )

    version added: 1.0

    key   A key for value to store.

    value   A value to store.

The jQuery.localStorage() method uses the native localStorage, if the localStorage object not available, the storage will be handled with cookies as fall back method.

  • Set a value to the local storage.

    Javascript:
    $.localStorage( 'foo', {data:'bar'} );
posted on 2013-12-08 01:16  lexus  阅读(1237)  评论(0编辑  收藏  举报