CodeMirror2 IE7/IE8 下面未知运行时错误的解决方法
2018-10-12 13:58
537 查看
原来出错的代码如下:
出错的原因应该是IE7、IE8中的P不支持innerHTML。CodeMirror的作者也发现了这个问题,相关链接:
https://github.com/marijnh/CodeMirror2/issues/215
https://github.com/marijnh/CodeMirror2/commit/4886415d6054571f92fa4d5601ebe7d601e952ab
把textarea外层的p改成div,即可正常:
<p style="margin-top:0;">
<asp:TextBox ID="txtContent" runat="server" TextMode="MultiLine" Height="450" Width="98%"></asp:TextBox>
</p>
出错的原因应该是IE7、IE8中的P不支持innerHTML。CodeMirror的作者也发现了这个问题,相关链接:
https://github.com/marijnh/CodeMirror2/issues/215
https://github.com/marijnh/CodeMirror2/commit/4886415d6054571f92fa4d5601ebe7d601e952ab
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>
您可能感兴趣的文章:
相关文章推荐
- CodeMirror2 IE7/IE8 下面未知运行时错误的解决方法
- js插件设置innerHTML时在IE8下提示“未知运行时错误”解决方法
- IE8 未知的运行时错误(ueditor编辑器在ie8、ie7下出现JS错误的解决方法)
- CodeMirror2 IE7 / IE8 下面未知运行时错误
- win7(32 bit) + IE8 环境,IE8无法弹窗(错误提示:“此网页上的错误可能会使它无法正确运行”),有关的系统注册信息损坏——解决方法
- innerHTML报“未知运行时错误”的解决方法
- Permission denied: win7下面eclipse上传本地文件到DFS && 运行M/R程序时出现的同样的错误解决方法
- Javascript在IE下设置innerHTML时出现未知的运行时错误的解决方法
- (转)Permission denied: win7下面eclipse上传本地文件到DFS && 运行M/R程序时出现的同样的错误解决方法
- Javascript在IE下设置innerHTML时出现未知的运行时错误的解决方法
- loadrunner 场景运行错误 error 81024解决方法
- mib2c报in_addr_t未知类型错误解决方法
- Windows7下安装Oracle 10g提示“程序异常终止,发生未知错误”的解决方法
- Windows7旗舰版下安装Oracle 10g提示“程序异常终止,发生未知错误”的解决方法
- python下运行报"SyntaxError: Non-ASCII character '/xe6' "错误解决方法
- 运行java程序产生hs_err_pid之类错误日志解决方法!
- ASP运行出错:缺少对象: 'xmlDoc.documentElement'错误解决方法
- Microsoft VBScript 运行时错误 错误 '800a0046' 没有权限 解决方法
- res://ieframe.dll/acr_error.htm错误解决办法|ie8网站还原错误真正可行解决方法
- IE8提示js错误(KB927917)解决方法