localStorage array of objects handling

后端 未结 3 764
野的像风
野的像风 2020-12-09 17:07

Array of JSON objects are stored in HTML5 localStorage.
For now delimiter is ;
For accessing and modifying array of object

3条回答
  •  难免孤独
    2020-12-09 17:20

    Read variables:

    var xyz = JSON.parse( localStorage.getItem( 'element' ) );

    Store variables:

    localStorage.setItem( 'element' , JSON.stringify(xyz));

    where element is the name of the local storage variable and xyz the name of the js variable.

提交回复
热议问题