相关疑难解决方法(0)

Chrome中的"未捕获的TypeError:非法调用"

当我用requestAnimationFrame以下代码做一些原生支持的动画时:

var support = {
    animationFrame: window.requestAnimationFrame ||
        window.mozRequestAnimationFrame ||
        window.webkitRequestAnimationFrame ||
        window.msRequestAnimationFrame ||
        window.oRequestAnimationFrame
};

support.animationFrame(function() {}); //error

support.animationFrame.call(window, function() {}); //right
Run Code Online (Sandbox Code Playgroud)

直接打电话给support.animationFrame意志......

未捕获的TypeError:非法调用

在Chrome中.为什么?

javascript html5 google-chrome typeerror

128
推荐指数
3
解决办法
13万
查看次数

标签 统计

google-chrome ×1

html5 ×1

javascript ×1

typeerror ×1