2

我在 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);          

    }    

  };
4

1 回答 1

0

问题解决了!事实证明,我必须将所有内容都放在 Scripts 文件夹中才能使其正常工作。无论如何感谢您的帮助。

于 2013-05-17T08:35:59.597 回答