Cannot store a value in local storage

后端 未结 2 1388

I have fetched a list of items from web service, now i want to store the item_name on which I have clicked. I cannot store that item name, if its \"bread butter\" , it stores on

相关标签:
2条回答
  • 2021-01-28 08:45

    DOM Storage Guide

    Example

    var string = 'Bread Butter';
    
    localStorage.setItem("DishName", string);
    
    alert(localStorage.getItem('DishName'));
    

    On jsFiddle

    0 讨论(0)
  • 2021-01-28 09:08

    I use Amplifyjs store library to access local storage.
    It's simple to use/understand, works really well and it's cross browser (mobile browser as well)

    Hope this Helps

    0 讨论(0)
提交回复
热议问题