sessionStorage not storing original object

后端 未结 2 1820
情深已故
情深已故 2021-01-25 10:06

I have an object which I\'m getting by executing a function of SDK. When I try to store the object in session storage and the retrieve the object, the retrieved object looks sam

2条回答
  •  灰色年华
    2021-01-25 10:30

    Try

    sessionStorage.setItem('xyzObject', JSON.stringify(xyzObject);
    

    And retrieve using:

      JSON.parse(sessionStorage.getItem('xyzObject'));
    

提交回复
热议问题