On Feb 24, 4:14 am, Christophe Porteneuve <[EMAIL PROTECTED]> wrote: > Hey there, > > Are you seriously saying you don't understand why explicitly reloading a > page erases all previously defined "global" variables?! > > I hope not. Because there IS NO global variable in JS. I wouldn't say that - ECMAScript (javascript) certainly *does* have global variables. The non-persistance of globals across documents is a host (browser) feature, it has nothing to do with the language per se. It is required in a browser for security and makes javascript easier to program with - memory management is vastly simplified. > There are only > page-scope variables. And they exist for the page's lifetime only, > (client-side speaking, of course). So when you navigate and go back, > your browser "restores" the page's scripting context (which is often > part of its in-memory short-term history storage), but when you > explicitely reload, you're effectively asking it to behave as if opening > the page for the first time in its session/cache. This is a brand new > scripting context. Absolutely. -- Rob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
