Flash 对象在动态添加到 IE 中的 DOM 时不起作用
Flash object doesn't work when dynamically added to the DOM in IE
我正在使用jQuery执行一个ajax请求,该请求返回一些html,然后将该html插入DOM中。该网页如下所示:
<div class="entry-details">
<div class="brightcove-player-wrap">
<!-- Start of Brightcove Player -->
<div style="display:none">
</div>
<!--
By use of this code snippet, I agree to the Brightcove Publisher T and C
found at https://accounts.brightcove.com/en/terms-and-conditions/.
-->
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience4733627893001" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="1130" />
<param name="height" value="500" />
<param name="playerID" value="4732606104001" />
<param name="playerKey" value="AQ~~,AAABAzMvv-k~,LozjqgbLEy1mFJ0QaG0FQ_ctTc2aT68o" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="@videoPlayer" value="4733627893001" />
</object>
<!--
This script tag will cause the Brightcove Players defined above it to be created as soon
as the line is read by the browser. If you wish to have the player instantiated only after
the rest of the HTML is processed and the page load is complete, remove the line.
-->
<script type="text/javascript">brightcove.createExperiences();</script>
<!-- End of Brightcove Player -->
</div>
<div class="entry-like">
<a href="" data-entry-id="291" class="btn btn-lime">Like <i class="icon-thumbs-up"></i></a>
</div>
<div class="entry-intro">
<span>Submitted by:</span> Geoff Meierhans<br>
<span>Location:</span> United Kingdom<br>
<span>Likes:</span> 0 </div>
<br>
<div class="question-1">
<h4>What message would you like to give to lung cancer patients?</h4>
<p>This is my message</p>
</div>
<br>
<div class="request-removal">
<a href="http://local.tagrisso.com/request_removal/291" class="btn btn-mulberry">Request Removal <i class="icon-remove icon-white"></i></a>
</div>
</div>
这在 chrome 中工作正常,但在任何版本的 IE 中都不起作用。如果页面加载时对象已经在页面上,它工作正常并且视频播放,但是当我使用 jQuery 动态插入它时,视频不会出现在 IE 中。
Could not complete the operation due to error 80020101
这是我在jQuery的1.9.1版本中使用的jQuery:
var request = $.ajax({
url: "user/get_message",
method: "POST",
data: { id : entryId },
dataType: "html",
cache: false
});
request.done(function(html) {
$('#entry-info').html(html);
});
任何人都知道为什么会发生这种情况以及可能的解决方案是什么?
更新
我设法通过在页面加载时包含 brightcove js 文件而不是动态地在 IE8 及更高版本中修复它。因此,将以下行从 ajax 响应移动到主 DOM 中:
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
不过,它在IE7中仍然不起作用,有人知道为什么吗?
最后,我不得不创建一个只打开视频的空白页面,然后动态添加一个显示该视频的 iframe。
相关文章:
- 为什么是文档.旧版应用程序中的DOM-object.properties为null
- 访问VueJS中的DOM元素
- 在 ng-if 编译后访问指令中的 DOM 元素
- AngularJS操作父'指令中的DOM
- JavaScript 中的 DOM 解析
- 在 Greasemonkey 中修改 Angular JS 中的 DOM 元素
- 如何编写一个抽象层来隐藏 jquery 中的 DOM 元素
- "撤消”;Javascript中的DOM操作函数
- 创建一个本地脚本来操作网站中的DOM元素
- Android原生浏览器中的dom处理时间太长
- 无法清除基于Jquery Mobile的应用程序中的Dom
- js初学者-如何在比网页中的DOM节点低一个级别上立即解析所有子节点
- 撤消JS中的dom更改
- IE中的DOM Level 2和3 Core支持
- 访问ng repeat指令中的DOM
- 获取javascript中的DOM元素哈希
- 使用字符串方法更改Javascript对象中的DOM元素参数
- 骨干,如何确保在视图中声明的函数只影响该视图中的DOM元素
- 未正确遍历表中的 DOM
- 如何将 javascript 中的 dom 从 SVG 更改为 HTML 页面