提交表单后如何在ckeditor中保存更改数据? [英] How to save changes data in ckeditor after submit form?

查看:350
本文介绍了提交表单后如何在ckeditor中保存更改数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JSP和CKEditor获取网站内容

 <  表单   方法  =  POST >  
< textarea id = 编辑器 name = editor > DEMO CKEDITOR < / textarea >
< 输入 type = 提交 value = 保存更改 >

< div id = content > < / div >

< script 类型 = text / javascript >
CKEDITOR.replace(' editor');
< / script >
< / form >





网站的内容是保存在div内容中。如何将它们加载到CKEditor中以编辑和保存更改?提交表格后,网站将显示新内容。



我尝试过:



我认为我们可以使用Ajax。但我是新手,我真的不明白。我愿意接受任何帮助。

提前致谢!

解决方案

你可以使用<获取编辑器中文本的值/ blockquote>

_POST [editor],并尝试相应保存。


I'm using JSP and CKEditor to get website's content

<form method="POST">
       <textarea id="editor" name="editor">DEMO CKEDITOR</textarea>
       <input type="submit" value="Save changes">

       <div id="content" ></div>

       <script type="text/javascript">
           CKEDITOR.replace('editor');
       </script>
</form>



The contents of webiste are saved in div "content". How can I load them into CKEditor to edit and save changes?. After submit form, the website will display new content.

What I have tried:

I think we can use Ajax. But I'm a newbie and I'm not really understand it. I'm open to any help.
Thanks in advance!

解决方案

you can get the value of the text in the editor using


_POST["editor"], and try to save accordingly.


这篇关于提交表单后如何在ckeditor中保存更改数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆