How do I access javascript functions in the "object Window" -
i feel silly asking in such crude way, in firebug see current object (this) , below line then, "object window," global namespaces seem live (e.g., there's $ object, jquery object ...). have object created called "g" function called "update" lives in global namespace (again, using term loosely).
am using right terminology here? jquery object live in "global namespace"? furthermore, if want call living here, need call, say, g.update()? right these equivalent of you'd call static variables in oo terminology?
thanks!
if understand question correctly, default last scope 'window', if didn't declare 'g' anywhere else in scope, last place in 'window'
working example
g = { update: function() {} }; function foo() { g.update(); } not working example:
g = { update: function() {} }; function foo(g) { g.update(); }
Comments
Post a Comment