I do most JavaScript programming with objects and methods. I
use tiny
boot and shutdown scripts as hooks for the browser load and
unload
events.
My JavaScripts interact with scripts running on the web
server. I need
to declare shared values (as constants) to assist
communication between
client and server. I declare constants using global
variables:
var CONSTANT_NAME = 'whatever';
I would prefer to avoid the global scope. I am also aware
that the
"constant" value can be modified by running code.
I toyed with the idea of a special Constant object that
would dispense
a shared value in response to invocation of a hardcoded
method. I
haven't attempted this approach yet, so it may have its own
special
complications.
Do you know of an alternative to global variables for shared
constants
that is cross browser?
Thanks,
Gerard Vignes
http://www.GerardVignes.c
om
Seattle, WA
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "OOP Javascript" group.
To post to this group, send email to OOP-Javascript googlegroups.com
To unsubscribe from this group, send email to
OOP-Javascript-unsubscribe googlegroups.com
For more options, visit this group at ht
tp://groups-beta.google.com/group/OOP-Javascript
-~----------~----~----~----~------~----~------~--~---
|