使用 yepnope 加载 Raphael 后,我尝试使用回调参数运行 Raphael - 按照以下部分:
http://raphaeljs.com/reference.html#Raphael
示例代码:
yepnope({
load: 'lib/raphael.js',
complete: function () {
Raphael('idm', 10, 10, function () {alert('callback run!')});
}
});
遗憾的是,该回调无法在 Firefox 和 IE 中运行。它确实在 Chrome 中运行。我该怎么做才能使回调在所有浏览器中运行?
最佳答案
我也有这个问题。当通过 YepNope 加载异步脚本时,回调函数不会在 IE 8 ,9 中运行。但firefox和chrome都可以。所以我决定通过“script”标签包含js文件。虽然它使加载时间变慢。
关于javascript - Raphael 未运行回调参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10920247/