[whatwg] question about Web Storage setItem()'s behavior

白石俊平 shumpei.shiraishi at gmail.com
Sun Aug 2 19:17:58 PDT 2009


Hi,

I'm implementing the HTML5 Web Storage using Gears
(http://code.google.com/p/gear5/), so I have several questions with
the spec.

-Storage.setItem(key, val)
--is key allowed non-string type object?
--and when pass non-string object to key/value, is it automatically
converted to string?(I'm considering to convert to use String
constructor - String(key) )
--when value is null, should `setItem("key", null)` behave as like as
`removeItem("key")`? (localStorage.setItem("key", null);
alert(localStorage.length); <-- what is value displayed?)

Shumpei


More information about the whatwg mailing list