I create a JS object in my code (The module pattern):
var Validator = {
regexEmail: /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/,
settings: {
error_class: "error-field",
formValid: true
},
init: function (form, default_error_class) {
self = this;
alert(self == window);
},
};
When running the "init" function on chrome, I get false for self == window (expected). But when I try it on IE9 I get true(!). Can you tell me why? I would expect 'this' to capture my custom Validator object and not the window