- 时间:2020-08-09 20:59 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:CodeMirror2 IE7/IE8 下面未知运行时错误的解决方法
原来出错的代码如下:
[url=https://github.com/marijnh/CodeMirror2/issues/215]https://github.com/marijnh/CodeMirror2/issues/215[/url]
[url=https://github.com/marijnh/CodeMirror2/commit/4886415d6054571f92fa4d5601ebe7d601e952ab]https://github.com/marijnh/CodeMirror2/commit/4886415d6054571f92fa4d5601ebe7d601e952ab[/url]
try { stringWidth("x"); }
catch (e) {
if (e.message.match(/runtime/i) || e.message.match(/运行时/i) )
e = new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)");
throw e;
}
把textarea外层的p改成div,即可正常:
<div style="margin-top:0;">
<asp:TextBox ID="txtContent" runat="server" TextMode="MultiLine" Height="450" Width="98%"></asp:TextBox>
</div>