我在 IE8 中不断收到“预期对象”错误,在 Chrome 和 Firefox 中运行良好。错误指向这段脚本:
<script type="text/javascript">
var oEdit1 = new InnovaEditor("oEdit1");
oEdit1.REPLACE("Description");
</script>
在 Visual Studio 中调试时,我也遇到了同样的异常。我不确定它是否相关,但这就是它所指向的:
this.arrParagraph = [
[getTxt("Heading 1"), "H1"],
[getTxt("Heading 2"), "H2"],
[getTxt("Heading 3"), "H3"],
[getTxt("Heading 4"), "H4"],
[getTxt("Heading 5"), "H5"],
[getTxt("Heading 6"), "H6"],
[getTxt("Preformatted"), "PRE"],
[getTxt("Normal (P)"), "P"],
[getTxt("Normal (DIV)"), "DIV"]
];
上面的代码可以在 InnovaStudio WYSIWIG Editor 源文件中找到。我在其他地方阅读了type="text/javascript"
应该替换的language="javascript"
内容并尝试了它但不起作用。有任何想法吗?
编辑这是 InnovaEditor 的初始化脚本:
edtCnt = document.createElement("DIV");
edtCnt.id = "innovaeditor" + i;
txt.parentNode.insertBefore(edtCnt, txt);
window["oEdit"+i] = new InnovaEditor("oEdit"+i);
var objStyle;
if( window.getComputedStyle ) {
objStyle = window.getComputedStyle(txt,null);
} else if( txt.currentStyle ) {
objStyle = txt.currentStyle;
} else {
objStyle = {width:window["oEdit"+i].width, height:window["oEdit"+i].height};
}
window["oEdit"+i].width=objStyle.width;
window["oEdit"+i].height=objStyle.height;
if(opt) {
for(var it in opt) {
window["oEdit"+i][it] = opt[it];
}
}
window["oEdit"+i].REPLACE(txt.id, "innovaeditor" + i);
}
};