2011-03-28 62 views
1

試圖找出爲什麼這個SWF這是通過JavaScript這是一個要求加載後,加載即得很好,但沒有任何其他瀏覽器誰能告訴我爲什麼這個.SWF加載到IE瀏覽器,但不是Firefox或鉻?

HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head> 
<meta http-equiv="content-type" content="text/html; charset=utf-8"> 
<title>Host&nbsp;Log-in</title> 

<!-- saved from url=(0014)about:internet --> 
<style type="text/css"> 
body { 
    background-color: #FFFFFF; 
} 
</style> 
</head> 

<body style="margin: auto;" onLoad="javascript: sf.focus()"> 
<br /> 
<script type="text/javascript" language="javascript"> 
<!-- 
    function doFSCommand(command, args) { 
    } 
//--> 
</script> 

<script language="VBscript" type="text/javascript"> 
<!-- 
    sub sf_FSCommand(ByVal command, ByVal args) 
    call doFSCommand(command, args) 
    end sub 
//--> 
</script> 

<img src="/img/infinite-logo.png" width="248" height="85" alt="Infinite"><br> 

<script language="javascript" src="swf.js" ></script> 

<br> 
</body> 
</html> 

JS:

document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1280" height="753" ID="sf" VIEWASTEXT>'); 
document.write(' <param name="movie" value="Host Log In.swf" />'); 
document.write(' <param name="menu" value="false" />'); 
document.write(' <param name="quality" value="high" />'); 
document.write(' <param name="wmode" value="window" />'); 
document.write(' <param name="allowScriptAccess" value="always" />'); 
document.write(' <param name="allowFullScreen" value="true" />'); 
document.write(' <embed src="Host Log In.swf" quality="high" name="sf" allowScriptAccess="always" allowFullScreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1280" height="753"></embed>'); 
document.write('</object>'); 
+0

我想你錯過了開幕詞'',除非我不小心將它編輯出來。我很抱歉看不到你的腳本有什麼問題,但使用[swfobject](http://code.google.com/p/swfobject/)這樣的工具通常會更容易。 – Rup 2011-03-28 18:09:57

+0

https://developer.mozilla.org/zh/HTML/Element/object「必須至少定義一種數據和類型。」 – 2011-03-28 18:12:35

回答

1

<embed>標籤不應位於<object>之內。嘗試將其移動到<object>標記之外,看看是否有幫助。

+0

太棒了,解決了它,謝謝。但現在IE正在拋出一個錯誤:預期';'代碼:0行:93字符:7 – NewB 2011-03-28 18:19:02

0
document.write('<object classid="... height="753" ID="sf" VIEWASTEXT>'); 
... 
document.write('</object>'); 

以這種方式創建節點是個壞主意。改爲使用document.createDocumentFragment()

相關問題