如何使用jquery的$post提交Html编辑器内容
自在修行 2011-09-17 12:40:07 我使用的是xheditor编辑器,如果内容为纯文字,提交正常,如果进行了格式修饰则无法提交,调试脚本时也没有任何错误提示,本以为是由于获取的内容中含有'"'导致,替换为"''"还是不行,到底该如何做?
var editor = $('#content')[0].xheditor;
var notice_content = editor.getSource();
notice_content = notice_content.replace(/\"/g,"''");
$.post("notice_addModi.aspx?action=post", {
title: $("#title").val(),
content: notice_content
}, function (data) {
$.messager.alert('提示', data, 'info'); // 把返回的数据添加到页面上
}
);