0
ここの質問によると、Can codemirror be used on multiple textareas?です。codemirror - 複数のテキスト領域が機能しない
自分のページに正確な設定を適用しましたが、どちらのテキストエリアもコードミラーに変換されていません。
コンソールにもエラーはありません。どちらが欲しいのか分かりませんか?次のように
私のコードは次のとおりです。
<script src="{% static 'home/scripts/codemirror/codemirror.js' %}"></script>
<link href="{% static 'home/scripts/codemirror/codemirror.css' %}" rel="stylesheet">
<script src="{% static 'home/scripts/codemirror/django/django.js' %}"></script>
<script type="text/javascript">
function editor(id) {
CodeMirror.fromTextArea(id, {
height: "400px",
continuousScanning: 500,
lineNumbers: true
});
}
editor('id_config');
editor('id_remote_config');
</script>
<form id="edit_template" action="" method="post">
{% csrf_token %}
{{ TemplateForm.template_name }}
{{ TemplateForm.config }}
{{ TemplateForm.remote_config }}
<input type='submit' value='Update' />
</form>
Djangoのフォームは、私は誰もが任意のアイデアを持っている
を指定したIDを持つテキスト領域をレンダリング? ありがとう
のフォームの下のすべてをまだ移動していませんか? – AlexW
ブラウザのコンソールにエラーがありますか? – charlietfl
TypeError:textarea.getAttributeは関数ではありません。 ( 'textarea.getAttribute( "autofocus")'、 'textarea.getAttribute'は未定義です) - codemirror 9512 – AlexW