javascript - swfObject 嵌入对象在 ie11 中不起作用

标签 javascript internet-explorer internet-explorer-11 flash swfobject

经过一整天的网络搜索,我没有找到任何解决我的问题的方法。

我在使用 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 上运行,因此我重新安装,一切都恢复正常。

http://get.adobe.com/fr/flashplayer/otherversions/

关于javascript - swfObject 嵌入对象在 ie11 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27314918/

相关文章:

html - 图像 slider 在 Chrome 中工作正常但在 IE11 中不工作

javascript - 如何通过文本框数组提交按钮

javascript - 删除剑道中百分比符号和数字之间的空格

asp.net - Internet Explorer 的操作中止和延迟问题

javascript - 为什么这个 JavaScript 会破坏我在 Internet Explorer 中的布局?

javascript - 无法在另一个域中使用 jQuery 访问 iframe 在 IE8-11 中

java - 在 Windows 8.1 中使用 IE11 从子窗口切换到父窗口时,Selenium WebDriver 挂起并卡住

javascript - 使用 href 属性时 ui-route 不起作用

javascript - 使用 jQuery 设计表格行交替 block 的更有效方法?

html - 背景图像未在 IE 中加载