-1

I am trying to implement the revealing module pattern in my js files in IE8. Given this code:

var foo = (function () {
//private members
var a, b, c, d;
var init = function () {
    var self = this;
    //public members
    var A, B, C, D
    var privateFunc = function () {
        /*..*/
    };
    var publicFunc = function () {
        /*..*/
    };
    return {
        A: A,
        B: B,
        C: C,
        D: D,
        publicFunc: publicFunc
    }
  }
} ());
$(function () {
  foo.init();
})

My issue is that in the jQuery document ready function, foo is always undefined, and I can't figure out what the problem is.

Xs10tial
  • 143
  • 2
  • 10

1 Answers1

0

The issue was that I was returning the public objects from the init function instead of from foo. Thanks for your help, all.

Xs10tial
  • 143
  • 2
  • 10