以前は Ace エディターの作成に成功していましたが、最近 CodeProjects という Web サイトを作成していて、Ace エディターを入れたいと思っていますfunction foo(items) {
var x = "All this is syntax highlighted";
return x;
}
。ページhttp://ace.c9.io/#nav=embedding&api=aceには、コードのみが必要であると書かれています。
<!DOCTYPE html>
<html lang="en">
<head>
<title>ACE in Action</title>
<style type="text/css" media="screen">
#editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
</style>
</head>
<body>
<div id="editor">function foo(items) {
var x = "All this is syntax highlighted";
return x;
}
</div>
<script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
</script>
</body>
しかし、それを埋め込もうとすると(または、サイトではなくエディターを作成するだけでも)、再び表示されるだけですfunction foo(items) { var x = "All this is syntax highlighted"; return x; }
助言がありますか?