1
當我創建臨時隱藏在選項卡中的SWF對象,因此無法在某些瀏覽器(如FireFox)中完全加載時,我似乎無法找到方法來確定SWF是否加載,所以我可以與它溝通。Javascript/SWFobject |確定在創建動態嵌入對象時是否存在swf對象
/* Generate SWF (onDocumentReady())*/
swfobject.embedSWF("graph.swf","line-graph-one","100%","250","8","expressInstall.swf",null,null,null,swfRegister);
/* Callback function
* -------------------
* Is triggered when SWF object has done it's job, which is fine, but not a
* suggestion that the SWF is actually loaded by the browser)
*/
function swfRegister(e){
console.log(e);
}
這是什麼不起作用。雖然該元素存在於DOM中,但無法以某種方式與其通信。火狐在這種情況下,沒有加載SWF,因爲父容器是隱藏的(顯示:無;)
document.getElementById('line-graph-one').reloadAll("foobar");
Resulting in: document.getElementById("map-one").reloadAll is not a function
當我點擊其中SWF已創建的標籤,因爲它僅適用。所以FireFox加載它。
我需要一種方法來檢查,如果它被加載,
它不起作用,因爲該元素已經存在於DOM中,但實際的SWF並未被FireFox加載。 (Firefox往往只加載SWF在屏幕上可見)。我將編輯我的帖子。 – dropson 2010-09-16 12:48:22
啊,如果這是個問題,你可以檢查一下它是否可見。 – BBonifield 2010-09-16 12:53:11
偉大的:)這工作 – dropson 2010-09-16 13:22:39