Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 17th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Revealing module pattern: object is undefined
  2. var foo = (function () {
  3. //private members
  4. var a, b, c, d;
  5. var init = function () {
  6.     var self = this;
  7.     //public members
  8.     var A, B, C, D
  9.     var privateFunc = function () {
  10.         /*..*/
  11.     };
  12.     var publicFunc = function () {
  13.         /*..*/
  14.     };
  15.     return {
  16.         A: A,
  17.         B: B,
  18.         C: C,
  19.         D: D,
  20.         publicFunc: publicFunc
  21.     }
  22.   }
  23. } ());
  24. $(function () {
  25.   foo.init();
  26. })