在Ace Editor中键入空格会导致特殊字符 [英] Typing spaces in Ace Editor results in special characters

查看:207
本文介绍了在Ace Editor中键入空格会导致特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在网站上安装了ace编辑器,尽管在开发环境中进行了测试,但现在使用相同的代码,我却遇到了输入错误-特别是在敲空格或删除时.

I've installed ace editor into my site, and although when I tested it in a dev environment , now with the same code I am experiencing typing errors - specifically when hitting space or delete.

当我单击空格时,会出现奇怪的字符.这是我的代码示例和所见内容的图像.

When I click space strange characters appear instead. Here is an example of my code and an image of what I am seeing.

$(function(){

var editor = ace.edit("editor");
editor.setTheme("ace/theme/chrome");
editor.getSession().setMode("ace/mode/html");

});

有人可以帮忙吗?

推荐答案

事实证明,此问题是因为我包含了以下脚本:

It turned out that this issue was because I included the script like:

<script src="src-min/ace.js"></script>

并且我应该包括以下属性:

and I should have included the following attributes:

<script src="src-min/ace.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>

这篇关于在Ace Editor中键入空格会导致特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆