Search code examples
jqueryace-editor

Typing spaces in Ace Editor results in special characters


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");

});

Can anybody help?

enter image description here


Solution

  • 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>