link: JSON for the masses
Time to get my JavaScript shit together and start bundling everything in appropriate objects. Aside from the obvious benefit of namespace collision prevention, how sexy is this template?
var obj = {
a : Object,
b : Array,
c : false,
d : null,
init : function() {
// set local object vars here
this.run();
},
run : function() {
// run bulk of behavior here
}
}
function initializer() {
obj.init();
// other init() methods go here
}
addEvent(window,'load',initalizer);
No comments:
Post a Comment