Members: Join   Log In
Conv Mike Roeder - Oh man, let this be the last of the testing.
Rank_guide
re: Javascript, window.onload and namespacing
Icon-thread a reply to Javascript, window.onload and namespacing
by Mike Roeder on Mar 31, 2008 - 02:27 PM read 221 times
 
Hey Eric - as we discussed, I think our best bet is to use Prototype for the event loading (Event.observe(window, 'load')) and perhaps the Prototype extend or Class creation for namespacing. Our issues involve IE compatability (which I think you've solved with the prototype Class creation), where all this javascript lives, and, do we load this BSG name-spaced script on every page? Or do we manually load it where needed? How does sub name-spacing work? For example, I have a bunch of scripts related to wiki versioning (for example). But I don't want to load ALL of the other BSG scripts - is there a way to do this? It's likely that it doesn't matter, I'm just curious.
  • Conv Marc Schriftman - @donkeyhighway - remember when Laura Branigan ripped Falco? Oh wait - you were only 6. http://tinyurl.com/67unrq
    Rank_member
    re: re: Javascript, window.onload and namespacing
    Icon-thread a reply to re: Javascript, window.onload and namespacing
     Icon-thread in a conversation thread started here

    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

Featured

nGen Collaboration v7.1
Project CBS
Project LIM
Project ITM
Wiki Archive
Concours Archive

Author Profile

Mike Roeder

Guide Rank_guide

Subscribe

Feed for nGenera Community:
Feed_small Public Secure_feed_16 Secure

Why subscribe? What is RSS?