我正在尝试在summernote中编辑文本,然后在提交时通过Ajax将表单数据发送给Codeignator 在ajax级别,代码看起来不错,但是当到达服务器时,将插入内联css标签(style =“ anything:anything”);更改为([removed] =“ anything:anything”);
var form = $('#' + form_id);
form.find('.summernotes').each(function () {
var now = $(this);
var str = now.code();
now.closest('div').find('.val').val(str);
});
var formdata = false;
if (window.FormData) {
formdata = new FormData(form[0]);
}
formdata.append('globalText', '<table class="table table-bordered"><tbody><tr><td>ikonami 11<br></td><td style="text-align: right;">ikonami 12<br></td></tr><tr><td>ikonami 23<br></td><td style="text-align: right;">ikonami 24<br></td></tr></tbody></table>');
$.ajax({
url: form.attr('action'), // form action url
type: 'POST', // form submit method get/post
dataType: 'html', // request type html/json/xml
data: formdata ? formdata : form.serialize(), // serialize form data
cache: false,
contentType: false,
processData: false,
beforeSend: function () {
var buttonp = $('.enterer');
buttonp.addClass('disabled');
buttonp.html(working);
},
success: function () {
return;
error: function (e) {
console.log(e)
}
});