I'd like to note that this shouldn't be part of Element Storage. The current
pattern is that you can store anything - functions, objects, elements, etc.
To store something in window.name would mean only items that can be
converted to strings safely. This would break the pattern expectation users
have for Element Storage, so I'd recommend calling it something else.

On Wed, Oct 1, 2008 at 9:00 AM, Oskar Krawczyk <
[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> wrote:

>
> Right, fair enough. Thanks for the suggestions Tom – will definitely
> look into those later tonight and eventually share the output.
>
> Kind regards,
> Oskar
>
> On Oct 1, 3:55 pm, Tom Occhino <[EMAIL 
> PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1131783&i=0>>
> wrote:
> > Hey Oskar,
> >
> > Element.Storage is not a part of the DOM tree by design, and is
> > designed to be emptied when the user leaves the page.  This is to
> > prevent certain leaks, (the behavior you describe is actually a leak
> > by definition).
> >
> > However, I can see how the behavior you describe would be useful, so
> > if you'd like you could perhaps overwrite window.store /
> > window.retrieve to use window.name as some form of persistent
> > storage.  Or you could create a new plugin alltogether with a unique
> > API... maybe something like:
> >
> > PersistentStorage.store('name', 'value');
> > PersistentStorage.retrieve('name');
> >
> > You could put a hash in window.name and and store and retrieve from it
>
> > maybe?
> >
> > Tom
> >
> > On Oct 1, 2008, at 10:30 AM, Oskar Krawczyk wrote:
> >
> >
> >
> > > Hi folks,
> >
> > > I was trying to figure out a way of using Element Storage on the
> > > window object but it doesn't seem to work as I'd expect. Basically I'm
> > > doing this:
> >
> > > window.store('name', 'some value');
> >
> > > Which works fine but only if we don't leave the page, as soon as we
> > > leave it, the value is being lost - which it shouldn't as that's a
> > > "window session".
> >
> > > Which leads me to the question: Is Element Storage something that is
> > > being done virtually - it is not a part of the DOM tree, is it? Is
> > > that how ES should work?
> >
> > > Best,
> > > Oskar
>
>
> ------------------------------
>  View message @
> http://n2.nabble.com/Element-Storage-on-window.name-tp1131513p1131783.html
> To start a new topic under MooTools Users, email
> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> To unsubscribe from MooTools Users, click here< (link removed) >.
>
>
>


-----
The MooTools Tutorial:  http://www.mootorial.com www.mootorial.com 
CNET Clientside:  http://clientside.cnet.com clientside.cnet.com 
-- 
View this message in context: 
http://n2.nabble.com/Element-Storage-on-window.name-tp1131513p1134423.html
Sent from the MooTools Users mailing list archive at Nabble.com.

Reply via email to