JS Object Tmplate


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.