javascript 的引用传递问题
(function () {
var root = this;
var test;
test = root.test = {};
root.test = {
showMessage: function (message) {
alert(message);
}
};
}).call(this);
test.showMessage("sdf");
(function () {
var root = this;
var test = {};
test["fun"]={};
root.test = test;
test["fun"]= {
showMessage: function (message) {
alert(message);
}
};
//console.log(test);
}).call(this);
test["fun"].showMessage("sdf");
(function() {
var root = this;
var test;
test = root.test = {};
test.showMessage=function(message) {
alert(message);
}
}).call(this);
test.showMessage("sdf");