Posted By

loric on 02/20/11


Tagged

javascript js object template


Versions (?)

JS Object Tmplate


 / Published in: JavaScript
 

  1. var obj = {
  2. a : Object,
  3. b : Array,
  4. c : false,
  5. d : null,
  6. init : function() {
  7. // set local object vars here
  8. this.run();
  9. },
  10. run : function() {
  11. // run bulk of behavior here
  12. }
  13. }
  14. function initializer() {
  15. obj.init();
  16. // other init() methods go here
  17. }
  18. addEvent(window,'load',inializer);

Report this snippet  

You need to login to post a comment.