我现在正在尝试从文件系统运行 Ace 编辑器,在 Chrome 中我得到:
"SECURITY_ERR: DOM Exception 18"
火狐不介意。
在谷歌群组上找到这个:
由于同源限制,无法从 cdn 加载工作人员,您需要将它们放在您的站点上,并添加 ace.config.set("workerPath", "path/to/ace/src-min");
没有喜悦。
我正在像这样初始化编辑器:
<script src="js/source-editor/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
ace.config.set( "workerPath", "js/source-editor/src-min-noconflict");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/css");
</script>
我错过了一些无可救药的简单吗?