I’m using tinymce. And I’m sending data by jquery ajax call like this
// update textarea from tinymce
tinyMCE.triggerSave (false,true);
$.post ('', $('#page_form').serialize (), function (x){
var ans = $.parseJSON (x);
if (ans.success)
{
// my work
but the server is getting
<p><span medium;="" font-family:="" \'andale="" mono\',="" times;\"="">aiwndiawnduawd </span><strong>waoid</strong></p>
but it should get
<p><span style="font-size: medium; font-family: 'andale mono', times;">aiwndiawnduawd </span><strong>waoid</strong></p>
I saw from js console that $(‘.tinymce’).val () returns correct value but somehow ajax call misses the value on the fly
Anyone faced this before? or any solution?
I have exactly the same problem. I’m going crazy! 🙁
It seems JQuery Ajax request (I use serializeArray function) don’t want accept anything like “”!!!
I’m sure that the problem isn’t TinyMCE (I try to “force” string, serialize it.. and “style” disapear!).. 🙁
(edit)
Are you using CodeIgniter framework? If yes, give a look to your application/config/config.php file and try to set $config[‘global_xss_filtering’] parameter to FALSE… It works for me! 🙂
If is your case, remember to use XSS filtering on POST, and GET where you must protect by scripting hack (visit CodeIgniter XSS manual page).
Otherwise try to debug by add/remove slashes (in jQuery and PHP), or manually look at the value of something like this ( before and after ajax):