Use SWFObject to embed the SWF, then use the callback function to poll the SWF's PercentLoaded value.
If the value is 0, the SWF has not loaded yet. When it hits 100, the SWF is fully loaded.
Here's a tutorial for polling PercentLoaded, complete with code examples.
浏览器去加载这些资源或者是异步去发
http
请求的话,一般都会提供钩子函数
。例如,你异步去获取
js
代码:你创建的
script
对象上提供了加载的钩子函数:onload/onreadystatechange
(浏览器的兼容性处理),当你把script
标签插入到DOM
中时,浏览器另开一个线程去异步加载你需要的js
资源,在加载的不同阶段:this.readyState
对应不同的值,这个时候根据需要设置你的回调函数。这样就完成了对于一段js
代码异步获取的监控。onload事件或者readystatechange事件,但不是所有对象都支持。另外promise应该也能吧
http://stackoverflow.com/ques...
可以考虑ajax或者fetch API