FF&中的SWFObject错误IE,在Chrome中运行良好

时间:2011-09-19 07:38:58

标签: javascript internet-explorer firefox google-chrome swfobject

我注意到在使用自动查看器(Flash库)时我的网站上有一个奇怪的问题。我之前从未注意过这个问题,并且我发誓它在几个月前工作正常,但我的画廊在Chrome中加载很好,但在IE和FF中显示的尺寸不正确。

这是我在IE中收到的错误:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Mon, 19 Sep 2011 07:30:23 UTC


Message: 'SWFObject' is undefined
Line: 114
Char: 3
Code: 0
URI: http://mikegreenephotography.com/sports/sports.html


Message: 'SWFObject' is undefined
Line: 125
Char: 3
Code: 0
URI: http://mikegreenephotography.com/sports/sports.html

在FF中我得到:

SWFObject is undefined
var fo = new SWFObject("autoviewer.swf", "autoviewer", "100%", "75%", "8", "#181818");      

在Chrome中,网站运行正常。我不明白。我感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

如果你查看网站的http响应,那么swfobject.js文件就会得到404:

Request URL:http://mikegreenephotography.com/swfobject.js
Request Method:GET
Status Code:404 Not Found

您需要将swfobject.js文件放在该位置,或更新HTML以反映正确的位置。

更改此行:

<script type="text/javascript" src="../swfobject.js"></script>

对此:

<script type="text/javascript" src="/sports/swfobject.js"></script>

它会正常工作。