我的代码是:
(function(){
var test=function(){
if(this === window)
return new test();
}
test.prototype.play = function(){
alert("Hello");
};
window.Test=test;
})();
window.onload=function(){
Test().play();
};
这可以很好地工作IE9+ firefox chrome,但是ie 6/7/8,错误显示Test().play();,谁能告诉我为什么?
错误信息是:
