IE 8 Script438 error
IE 8 Script438 error
Internet Explorer 8再次出现。。。
我一直在寻找SCRIPT438错误的解决方案(SCRIPT438:对象不支持此属性或方法),但似乎都不适合我
我正在使用swfoject.js,F12控制台上的错误报告显示,第435行字符5有一个错误,这一行:
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
这行是这个功能的一部分:
function createSWF(attObj, parObj, id) {
var r, el = getElementById(id);
if (ua.wk && ua.wk < 312) { return r; }
if (el) {
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
attObj.id = id;
}
if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
var att = "";
for (var i in attObj) {
if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
if (i.toLowerCase() == "data") {
parObj.movie = attObj[i];
}
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
att += ' class="' + attObj[i] + '"';
}
else if (i.toLowerCase() != "classid") {
att += ' ' + i + '="' + attObj[i] + '"';
}
}
}
var par = "";
for (var j in parObj) {
if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
}
}
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
r = getElementById(attObj.id);
}
所以'el'不应该是未定义的
这就是我将所有javascript添加到HTML 的方式
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="js/smoothscroll.js"></script>
<script src="js/jquery.placeholder.min.js"></script>
<script src="js/javascript.js"></script>
<script src="js/swfobject.js"></script>
<script src="js/player.js"></script>
我没有两次包含jquery,jquery.placeholder是我用来解决源代码中ie9占位符问题的插件https://github.com/mathiasbynens/jquery-placeholder
我必须在周一之前解决这个问题,真的需要一些帮助
从实际意义上讲,如果您的项目使用编译,您可能会考虑安装polyfill包
npm i --save core-js
或
yarn add core-js
然后在项目的入口点顶部添加
import 'core-js'
目前,core-js-polyfill库是使跨浏览器支持的最简单方法
相关文章:
- jQuery Error adadvisor.net
- Ajax调用ERror Cross Origin REquest:在rails中自动完成大学列表
- 类型error primeFactors.for不是函数
- Array.every返回false,而不是类型error
- datatables.net ajax error - http://datatables.net/tn/7
- Error: timers.js:234 callback.apply(timer, args);
- SCRIPT438:对象没有't支持属性或方法'endsWith'在IE10中
- 滚动到错误字段ERROR
- Error with xmlhttpresponse
- ajax javascript 500 error
- 将数据从ExpressJS发送到AngularJS ERROR json
- walkscore API JSON error
- STRIPE.JS Error
- Angular Routing Pretty URL Error
- 节点回调参数无法断言instanceof Error
- Jasmine .calls.count and .calls.any throwing error
- React.render error
- 如何访问npm模块抛出的自定义错误对象[error:[object object]]
- grunt contrib jshint-error在定义之前就已经使用过了
- IE 8 Script438 error