经过一整天的网络搜索,我没有找到任何解决我的问题的方法。
我在使用 swfObject 加载网页中的 swf 文件时遇到问题,在 IE11 中不起作用(在 ie8-10、firefox 和 chrome 中工作正常)
这是我的背景: 这是通过 swfObject 发送到 IE 的参数的初始化 `
// For version detection
var swfVersionStr = "10.0.0";
// To use express install, set to playerProductInstall.swf
var xiSwfUrlStr = "commun/swf/playerProductInstall.swf";
//FlashVars : contains an url used for an http request that returns the crossdomain.xml file with the crossDomainPolicy...
var flashvars = {
crossdomainURL : httpOrigin + "the.url.to.crossdomain.policy.file"
};
var params = {};
params.quality = "high";
params.bgcolor = "white";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "dematMultiuploader";
attributes.name = "dematMultiuploader";
attributes.align = "middle";
swfobject.embedSWF(
"the/url/to/SWFfile.swf", "falshContentID",
"550", "280",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
` 这是我的对象标签
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550" height="280" id="dematMultiuploader">
<param name="movie" value="path/to/swf/file.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="white" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="gedemat/gecco/piece/pieceDocument.create.swf"
width="350" height="130" id="dematMultiuploader">
<param name="quality" value="high" />
<param name="bgcolor" value="white" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--<![endif]-->
<!--[if gte IE 6]>-->
<p>Either scripts and active content are not permitted to run or
Adobe Flash Player version 10.0.0 or greater is not installed.</p>
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer"> <img
src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
alt="Get Adobe Flash Player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</noscript>
正如您所看到的,IE 的 Object 标记中没有 flashVars 参数,这可能是问题所在吗?
可能是 IE 更改了 IE11 的一些参数名称,例如 crossDomainUrl?
我已经尝试将 flashvars 参数放入具有 crossDomain url 的对象标记中,但它不起作用。
在 Firefox 和 Chrome 中我收到此错误:
网络错误:404未找到 - http://localhost:8080/crossdomain.xml
因此,他们尝试直接在服务器的根目录加载文件,但没有成功,但它仍然有效,因为在此调用之前已经加载了 crossdomain.xml。也许 IE 在那个特定时刻找不到这个文件?不考虑之前加载的?
有什么想法吗?
最佳答案
找到解决方案了! 在 Internet Explorer 11 的官方文档中我发现了这一点:
The preinstalled version of Adobe Flash isn't supported on Internet Explorer 11 running on either Windows 7 SP1 or Windows Server 2008 R2 with SP1. However, you can still download and install the separate Adobe Flash plug-in.
这是它的链接:http://technet.microsoft.com/en-us/library/dn268945.aspx
由于我在 Windows 7 SP1 上运行,因此我重新安装,一切都恢复正常。
关于javascript - swfObject 嵌入对象在 ie11 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27314918/