質問編集履歴
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -41,4 +41,43 @@
|
|
41
41
|
|
42
42
|
もとは、QuickStartの[デモコード](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/quick-start.html)に、[BasicAPI](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/basic-api.html)の、setData()関数のサンプルコードを1行追加しただけです。
|
43
43
|
|
44
|
-
どこが間違っているのか、教えていただけますでしょうか。
|
44
|
+
どこが間違っているのか、教えていただけますでしょうか。
|
45
|
+
|
46
|
+
---------------------------------------------------------------------------------------------
|
47
|
+
querykumaさんから回答をいただき、新しい疑問点を追加しました。
|
48
|
+
|
49
|
+
送信ボタンを押すと、エディタ内の文書をデータとして取ってくる、getData()を同じように使ってみましたが、エラーが発生しました
|
50
|
+
|
51
|
+
```JavaScript
|
52
|
+
<head>
|
53
|
+
<meta charset="utf-8">
|
54
|
+
<title>CKEditor 5 – Classic editor</title>
|
55
|
+
<script src="https://cdn.ckeditor.com/ckeditor5/12.3.1/classic/ckeditor.js"></script>
|
56
|
+
</head>
|
57
|
+
<body>
|
58
|
+
<h1>Classic editor</h1>
|
59
|
+
<textarea name="content" id="editor">
|
60
|
+
<p>This is some sample content.</p>
|
61
|
+
</textarea>
|
62
|
+
<input type="submit" value="送信" onclick="func1">
|
63
|
+
<script>
|
64
|
+
ClassicEditor
|
65
|
+
.create( document.querySelector( '#editor' ) )
|
66
|
+
.then( editor => {
|
67
|
+
console.log( editor );
|
68
|
+
|
69
|
+
|
70
|
+
} )
|
71
|
+
.catch( error => {
|
72
|
+
console.error( error );
|
73
|
+
} );
|
74
|
+
var func1 = function(){
|
75
|
+
const data = editor.getData();
|
76
|
+
console.log(data);
|
77
|
+
};
|
78
|
+
</script>
|
79
|
+
</body>
|
80
|
+
</html>
|
81
|
+
```
|
82
|
+
|
83
|
+
解決するには、何を勉強したらよいでしょうか?
|