我有以下JS命名空间&功能:
email.js :
window.EMAIL = window.EMAIL || {};
EMAIL.Add = (function () {
var add = { };
function Test() {
alert('EMAIL.Add.Test');
}
}
SCSD.js :
window.SCSD = window.SCSD || {};
SCSD.Add = (function () {
var add = { }
function Test() {
EMAIL.Add.Test();
}
}
但是我在执行时遇到了这个错误:
Uncaught TypeError: EMAIL.Add.Test is not a function
我错过了什么?
答案 0 :(得分:0)
试试这个?
window.EMAIL = window.EMAIL || {};
EMAIL.Add = {};
EMAIL.Add.Test = function() { alert('EMAIL.Add.Test'); }