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?
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>
It seems like the
charset="utf-8"
is the important part.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With