strap.js
Documentation
Browser compatibility
This library is designed to be used in all modern browsers and Node.js.
Known issues
- phantomjs not fully supported! At the moment some unit tests are failing (namespace loader) due to some strange errors with qunit and phantomjs
HelloWorld the simple way
// define the classvar Hello = ; // create instances of the the classvar instance1 = "World";var instance2 = "strap.js"; // work with the instancesinstance1; // --> "Hello World!"instance2; // --> "Hello strap.js!" // overwrite instanceinstance1 = "Ninja";instance1; // --> "Hello Ninja!"
HelloWorld with namespaces
Class definition:
;
Class usage:
// register the namespaces to usevar used = ; // create an instance using the loadervar tst1 = used; // create an instance using the load with callbackvar tst2 = used; // --> "callback Dude!" // create an instance without the loader but the whole namespacevar tst3 = 'Ninja!'; // work with the instancestst1; // --> "Hello World!"tst2; // --> "Hello Dude!"tst3; // --> "Hello Ninja!"