繁体   English   中英

如何使用JavaScript从tinyMCE获取格式化的内容?

[英]How to get my formatted content from tinyMCE using javascript?

我已经安装了TinyMCE,当我的表单以传统方式发布(进入某些php页面)时,这不是问题,原因是我可以通过throug stripslashes()函数或类似的函数传递变量。

不幸的是,我的表单之一是通过jquery $ .ajax模块传递的-不可能进行任何PHP操作。 有没有办法通过javascript传递完整格式的tinyMCE输出,因为现在它看不到我已经完成的任何格式化。

根据以下答案: https : //stackoverflow.com/a/6541822/349012可能:

// Get the HTML contents of the currently active editor
tinyMCE.activeEditor.getContent();

// Get the raw contents of the currently active editor
tinyMCE.activeEditor.getContent({format : 'raw'});

// Get content of a specific editor:
tinyMCE.get('content id').getContent()

另一个参考: https : //stackoverflow.com/a/11112221/349012

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM