次に、AceをHtmlに埋め込みます。 適当なHtml(仮に ace.html とします)を作成し、先ほどのsrcディレクトリと同じ位置に置きます。 そして、ace.htmlを以下のように編集します。 <html> <head> </head> <body> <div id="editor-div" style="height: 500px; width: 500px">ここがエディタになります</div> <script src="src/ace.js" type="text/javascript" charset="utf-8"></script> <script> window.onload = function() { var editor = ace.edit("editor-div"); }; </script> </body> </html>
![簡単にブラウザに埋め込めるWebテキストエディタ “Ace” を使ってみる](https://cdn-ak-scissors.b.st-hatena.com/image/square/fb82e018058b1db46e904d436ec4d1ed4e27d2c4/height=288;version=1;width=512/https%3A%2F%2Fblog.asial.co.jp%2Fwp-content%2Fuploads%2F2022%2F07%2Fdefault.png)