This works in Chrome but not IE, why?

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

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

Answers


alert.apply is the problem. Alert is not part of the language, so it may not be even a function. It is implementation-dependent.


Need Your Help

Convert base64 contents in a string

php image base64

Here is my problem (PHP), i've a String which could be like that :

Should I use a class in this: Reading a XML file using lxml

python design-patterns

This question is in continuation to my previous question, in which I asked about passing around an ElementTree.