$( 'textarea.editor' ).ckeditor({ on: { change: function( evt ) { var name = this.name; var textarea = $('textarea[id="'+name+'"]'); textarea.trigger( "change" ); } } }); 

There is a textarea with a change event and a ckeditor is hung on it. After an event, for some reason, the value is not as it should be, and the code:

 textarea.change(function() { var value = $(this).val(); $.ajax({ type: "POST", url: "edit.php", data: 'value='+value, success: function(msg){ } }); }); 

Does not transmit the correct value. Transmits only one line, i.e. in the debugger instead of

value:

Protection Kit, Blue / White

Transmitted

value =

Protection Kit, Blue / White

  • I stare for 2-3 minutes and see that the results are the same. - DimenSi
  • Not! in the first case, transmits as POST in the list: param1: 123, param2: 321, value: <p> ... And in the second - by the parameter string, similar to GET param1 = 123 & param2 = 321 & value = <p> ... And saved in value value before a line when received via POST - Gleb
  • So you are sending a POST request, and arrange it as a query string, using the equality symbol: data: 'value='+value . Where to take colons? And what kind of bike do you invent? Since you are using jQuery, pass the JavaScript object to the data parameter, which itself is then serialized as it should, or generate the body of the POST request yourself using the .serialize() method. - neluzhin

0