日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

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

ueditor在IE8下點(diǎn)擊任意文本框報(bào)腳本錯(cuò)誤

錯(cuò)誤問題:

在IE8下出現(xiàn)腳本錯(cuò)誤 'undefined' 為空或不是對(duì)象 的問題

出現(xiàn)問題的文件為:

行數(shù):299行

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

報(bào)錯(cuò)的代碼為:

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;

}

});

錯(cuò)誤原因?yàn)?#xff1a;299行中的

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

傳遞進(jìn)來的str變量未經(jīng)過判斷

在函數(shù)開始處增加

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

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;

}

};

總結(jié)

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

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。