日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

ie8 js未指明的错误_修复ueditor百度编辑器在IE8下shCore.js报错'undefined'错误的问题...

發布時間:2025/3/20 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ie8 js未指明的错误_修复ueditor百度编辑器在IE8下shCore.js报错'undefined'错误的问题... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

ueditor在IE8下點擊任意文本框報腳本錯誤

錯誤問題:

在IE8下出現腳本錯誤 'undefined' 為空或不是對象 的問題

出現問題的文件為:

行數:299行

文件路徑:ueditor\third-party\SyntaxHighlighter\shCore.js

報錯的代碼為:

299行

real.replace.call(str.toString().slice(match.index), r2, function () {

for (var i = 1; i < arguments.length - 2; i++) {

if (arguments[i] === undefined)

match[i] = undefined;

}

});

錯誤原因為:299行中的

str.toString().slice(match.index)

傳遞進來的str變量未經過判斷

在函數開始處增加

if(str!==undefined) 既可以修復該問題

RegExp.prototype.exec = function (str) {

if(str!==undefined){

var match = real.exec.apply(this, arguments),

name, r2;

if (match) {

// Fix browsers whose `exec` methods don't consistently return `undefined` for

// nonparticipating capturing groups

if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {

r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));

// Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed

// matching due to characters outside the match

real.replace.call(str.toString().slice(match.index), r2, function () {

for (var i = 1; i < arguments.length - 2; i++) {

if (arguments[i] === undefined)

match[i] = undefined;

}

});

}

// Attach named capture properties

if (this._xregexp && this._xregexp.captureNames) {

for (var i = 1; i < match.length; i++) {

name = this._xregexp.captureNames[i - 1];

if (name)

match[name] = match[i];

}

}

// Fix browsers that increment `lastIndex` after zero-length matches

if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))

this.lastIndex--;

}

return match;

}

};

總結

以上是生活随笔為你收集整理的ie8 js未指明的错误_修复ueditor百度编辑器在IE8下shCore.js报错'undefined'错误的问题...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。