我有以下swf:
<head> # load js <script> function graph() { swfobject.embedSWF( "open-flash-chart.swf","chart","400","180","9.0.0","expressInstall.swf",{"data-file":"{% url monitor-graph %}"}); }; </script></head> <div id="chart"> </div> <script> graph(); </script>
解决方法
embedSWF的最后一个参数是一个在嵌入swf时调用的回调函数.它接收一个事件对象,其中包含一些表示成功/失败的属性等.更多信息,请参见swfobject
documentation.
swfobject.embedSWF( "open-flash-chart.swf",{"data-file":"{% url monitor-graph %}"},{},function(e) { if(e.success) graph(); } );