Menu

#48 HTML5 localStorage is undefined

Duplicate
nobody
None
Medium
Defect
2011-08-08
2011-08-04
Anonymous
No

Originally created by: aflx...@gmail.com

Google Chrome version: 13.0.782.107
SDK + Eclipse Debugger version(s): 3.7.0
OS + version: Ubuntu 11.04

What steps will reproduce the problem?
1. prepare a project and enter the following code as script
1. localStorage.setItem("test", "info");
2. localStorage.getItem("test");

What is the expected result?
localStorage.getItem("test") == "info"

What happens instead?
localStorage.getItem("test") == undefined

Is it possible to use this HTML5 feature? The problem is, that I need to write/read the localStorage, but I always get "undefined".

Related

Tickets: #49

Discussion

  • Anonymous

    Anonymous - 2011-08-04

    Originally posted by: aflx...@gmail.com

    I have to specify this issue a little:

    undefined is only displayed in the variables view under <GLOBAL>
    If I assign the result of localStorage.getItem("test") to a varibale it contains the right value.

     
  • Anonymous

    Anonymous - 2011-08-05

    Originally posted by: peter.ry...@gmail.com

    Could you please describe your steps more in Eclipse terms?
    Like start debugger, add watch expression etc.

    Is is a problem with debugger or a problem with HTML5?

    Peter

     
  • Anonymous

    Anonymous - 2011-08-05

    Originally posted by: aflx...@gmail.com

    Hi Peter,

    I think it is a problem of the debugger. If you start the debugger, wait until it holds on a breakpoint and go to the variables view, there you will see that all items under localStorage are "undefined".

    If you do the same in the script view of Google Chrome (ctrl+shift+j) everything is fine. You will see that all localStorage variables under "Scope Variables" are defined.

    I think this is not a critcal bug, but sometimes it would be great if you could see the content of the localStorage on runtime.

    Alex

     
  • Anonymous

    Anonymous - 2011-08-08

    Originally posted by: peter.ry...@gmail.com

    (No comment was entered for this change.)

    Mergedinto: 49
    Status: Duplicate

     
  • Anonymous

    Anonymous - 2011-08-08

    Originally posted by: aflx...@gmail.com

    Thanks a lot! The next time I will write a better report :-)

     

Log in to post a comment.