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.