|
|
re: re: Javascript, window.onload and namespacing
by Marc Schriftman on Apr 01, 2008 - 05:07 PM read 153 times |
So, I've found a slightly nicer wrapping around the Dean Edwards solution that was actually included in a few plugins floating around for Rails. I've attached a simple test set to see how it works. The idea is essentially to create a BsgClass that gets all our methods as we need it. New scripts can attache more methods or objects to the class and we'll trust our FastInit (the lib I mentioned above) to load up our instance. In theory we could probably then figure out an import/require scheme to help reduce loading too much, but honestly, we aren't at that point in in terms of size or anything so I'm not too worried.
javascript_namespaces.zip


