sg

Perşembe, Kasım 24, 2005

Re: Javascript Variables Reset When Minimized


i.e. Is the stop watch running? How long has it been running?

Shutting down GDS seems like popping out the stop watch battery.
You'll lose all state and that's expected and perhaps desired.

Minimizing and maximizing seems like looking away from the watch for a
moment. If I'm timing something and look away for a moment, I don't
expect to see the watch stopped and set to 0.0.0 when I look at it
again.

Using permanent storage via the options object is like being able to
pop out the battery, and put it back it in and have everything act as
if the battery was never popped out. This might be a cool bonus
feature for some applications, but other applications will have to do
some time difference checking and make a guess as to whether it's
recovering from a shutdown.

For this plugin, I can work around my issue by using the options object
and replacing just about every variable with a method call to retrieve
the value from there. For the next plugin I was planning, I'm going to
have to do a bunch of heartbeat checking to get around this.

Effectively, it seems like I can't rely on any non-static variable that
I might want to use but don't want permanently store. Not a total show
stopper, but a bit flabbergasting.

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık