A simple scaffold for your client side JavaScript.
After renaming your Architect.js file, include it before the closing body tag.
<script src="Architect.custom.js"></script>
<script>
MyAppName.extend({
foo: function(){
alert('bar');
}
});
MyAppName.foo(); // Alerts "bar"
MyAppName.privatize(); // Nothing can be extended now
</script>
This method allows you to do the following:
- Private methods/vars
- Public methods/vars
- Extensibility/modularity
- Clean, bundled, and concise
- This is one of many ways of structuring your JS code. No extensive documentation on this code will be provided because this code should be organic, it should change to fit your needs.
_log()
is an internal wrapper forconsole.log()
.var NameSpace
should change to whatever you want.