我已经安装了 TinyMCE,当我的表单以传统方式发布(到某个 php 页面)时,这不是问题,因为我可以通过 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()
关于javascript - 如何使用 javascript 从tinyMCE 获取我的格式化内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12475029/