namespacing large javascript like jquery
- by frenchie
I have a very large javascript file: it's over 9,000 lines. The code looks like this:
var GlobalVar1 = "";
var GlobalVar2 = null;
function A() {...}
function B(SomeParameter) {...}
I'm using the google compiler and the global variables and functions get renamed a,b,c... and there's a good change that there might be some collision later with some outside code.
What I want to do is have my code organized like the jquery library where everything is accessible with $. Is there a way to namespace my code so that everything is behind a # character for example.
I'd like to have this to call my code:
#.GlobalVar
#.functionA(SomeParameter)
How can I do this?
Thanks.