Skip to content
Javascript Classloader
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Javascript Classloader

Dynamically load Javascript to current Page.


Create the ClassLoader:

window.classLoader = new Bratler_Component_ClassLoader();

Add a Prefix:

classLoader.addPrefix('Vendor_namespace_foo', '');

Create an Instance of Vendor_namespace_foo_bar_baz()

var theBaz = classLoader.create('Vendor_namespace_foo_bar_baz', someArg, someOtherArg);

This will try to include the contetns of file ''

You can also use new as usual, just load the Class before:

var theBaz = new Vendor_namespace_foo_bar_baz(someArg, someOtherArg);

Create or get a singleton instance:

var theBaz = classLoader.createSingleton('Vendor_namespace_foo_bar_baz', someArg, someOtherArg);

Use a minified Javascript Version:

classLoader.addSuffix('Vendor_namespace_foo', '.minified.js');

Now the ClassLoader tries to get the contents from '...baz.minified.js' instead of '...baz.js'

You can’t perform that action at this time.