[Greasemonkey] Backups and sharing GM installs on multiplemachines

Jeremy Dunck jdunck at gmail.com
Tue Apr 5 01:10:04 EDT 2005


On Apr 4, 2005 11:48 PM, Aaron Boodman <zboogs at gmail.com> wrote:
> You didn't declare the variable.
> 
> A very unfortunate wart in javascript's design is that undeclared
> variables are global by default instead of local. It's considered very
> bad form for this reason to use variables that weren't declared with
> "var".
> 
> On Apr 4, 2005 9:28 PM, Edward Lee <edilee at gmail.com> wrote:
> > Really? Is it just the anonymous function wrapper? I've been using..
> >
> > (function() {
> >   d = document;
> > })();
> >
> > And d is still set. Just that functions are lost when leaving the
> > anonymous function.

One of these days, I'm going to learn to test before writing on public
mail lists.  :)

I thought that within function in scope, undeclared variables would be
scoped to the function.  Yeesh.


More information about the Greasemonkey mailing list