Categories

jQuery.sessionStorage()

Categories: Data

jQuery.sessionStorage( key )Returns: Object

Plugin: jQuery.storage

Description: Get a value from the session storage.

  • jQuery.sessionStorage( key )

    version added: 1.0

    key   A key of a stored value.

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

  • Get a value from the session storage.

    Code:
    $.sessionStorage( 'foo', {data:'bar'} );
    
    $.sessionStorage( 'foo' );
    Results:
    {data:'bar'}

jQuery.sessionStorage( key, value )

Plugin: jQuery.storage

Description: Set a value to the session storage.

  • jQuery.sessionStorage( key, value )

    version added: 1.0

    key   A key for value to store.

    value   A value to store.

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

  • Set a value to the session storage.

    Code:
    $.sessionStorage( 'foo', {data:'bar'} );