这适用于Chrome,但不适用于IE,为什么?

时间:2010-07-06 12:38:49

标签: javascript global apply window-object

var shell = function (method) {
        window[method].apply(null, Array.prototype.slice.call(arguments, 1));
    };

shell('alert', 'monkey!');

1 个答案:

答案 0 :(得分:10)

alert.apply 是问题所在。 警报不是语言的一部分,因此它甚至可能不是一个功能。它是依赖于实现的

相关问题