2011-03-28 26 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()

相关问题