我一直在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);
}
};
答案 0 :(得分:0)
问题解决了!事实证明我必须将所有内容放在Scripts文件夹中才能使其正常工作。无论如何,谢谢你的帮助。