Ian Hickson wrote:
Sorry, I don't follow what you mean. The loop is possible of course, but what should the result be? If I have a sessionStorage object |s| with 10 items, the length will be 10. Should I expect |s[i]| for i=0,..., 9? If so what will be the result, keys? items? Can I set values, eg s[2] = "howdy"?On Tue, 28 Apr 2009, John J. Barton wrote:Hi. I work on Firebug, a web page debugger for Firefox (http://getfirebug.com).In attempting to show developers relevant information about all objects in their program I was trying to display window.sessionStorage. In the process I read the document http://dev.w3.org/html5/webstorage/. I found the document unnecessarily confusing because it uses the property 'length' for Storage. This is the same property used by _javascript_ Array type, but Storage is not an array and you cannot enumerate the elements of the Storage object |s| using for(var i = 0; i < s.length; i++)...This is in fact possible. Actually I take it back. The current document at the URL above only uses enumerating once, and there is qualified by properties. I was given a quote from an earlier document I suppose. Thanks, jjb |
- Storage 'length' and enumeration John J. Barton
- Re: Storage 'length' and enumeration Ian Hickson
- Re: Storage 'length' and enumeration John J Barton
- Re: Storage 'length' and enumeration Ian Hickson
- Re: Storage 'length' and enumeration John J. Barton
- Re: Storage 'length' and enumerati... Ian Hickson
- Re: Storage 'length' and enume... John J. Barton
- Re: Storage 'length' and e... Ian Hickson
- Re: Storage 'length' and e... John J. Barton
- Re: Storage 'length' and e... Ian Hickson
- Re: Storage 'length' and e... John J Barton
- Re: Storage 'length' and e... Anne van Kesteren
- Re: Storage 'length' and e... John J Barton
