1) IE 8 でtypeof(window["alert"]) が「オブジェクト」であり、機能しないのはなぜですか?
2) "window.alert" で apply メソッドを呼び出すにはどうすればよいですか? 私がやろうとしていることはこれです:
function exec(method, param)
{
//because of typeof(window["alert"]) == "object" the actual if looks like typeof(window[method]) == 'function' || method == 'alert'
if(typeof(window[method]) == 'function')
{
window[method].apply(window, [param]);
}
}
exec("alert","hello");