I have a web form that I'm $.posting that contains a CKEditor textarea.
$(document).ready(function() {
CKEDITOR.replace('html');
CKEDITOR.config.htmlEncodeOutput = true; //seems to have no effect
$('#save').click(function() {
$.post('/async.php?a=save-slide', $('#slideForm').serialize(),
function(json) {
console.log(json);
}, 'json');
});
});
I have two problems:
- .serialize() isn't getting the CKEditor contents. If I console.log the serialized string, html= is empty.
- If I use the CKEditor getData() method and there is an ampersand ( ) in the POSTed content, my script breaks because it's making an XML-based API call.
Any ideas on how I can get the contents and safely POST xml-friendly data?