我在表单中使用 CK5 内联编辑器,我需要使用 AJAX php 将值保存到数据库中。我已经在我的项目文件夹中安装了 CK5 内联编辑器,它可以用于其他样式。我需要将图像上传到服务器并显示。我努力了。我收到“Uncaught ReferenceError: CKEDITOR is not defined”错误。 下面是我的代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CKEditor 5 – Inline editor</title>
<script src="http://localhost/cmm/dev2/ckeditor5-build-inline-31.1.0/ckeditor.js"></script>
</head>
<body>
<h2>Classic CKEditor5</h2>
<div id="editor">
<textarea>Inline CKEditor Working Fine</textarea>
</div>
<script>
InlineEditor
.create( document.querySelector( '#editor' ),{
toolbar: {
items: [
'heading', '|',
'fontfamily', 'fontsize', '|',
'alignment', '|',
'fontColor', 'fontBackgroundColor', '|',
'bold', 'italic', 'strikethrough', 'underline', '|',
'link', '|',
'outdent', 'indent', '|',
'bulletedList', 'numberedList', '|',
'insertTable', '|',
'uploadImage', 'blockQuote', '|',
'undo', 'redo'
],
shouldNotGroupWhenFull: true
},
heading: {
options: [
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
{ model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
{ model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }
]
}
} )
.catch( error => {
console.error( error );
} );
</script>
<script>
CKEDITOR.replace( 'editor', {
height: 300,
filebrowserUploadUrl: "upload.php"
});
</script>
</body>
</html>
How to upload image path to server