Hello. Since I send the form to the Ajax, I have to pass the data from the textarea through an escape (). The question is, is it possible to decode php into normal characters like php? Here is the send function.
$('#form').on('submit', function(e) { e.preventDefault(); var form = $('#form'); var formData = form.serialize(); var body = tinymce.editors['body'].getContent(); $.ajax({ url : form.attr("action"), type : form.attr("method"), data : formData + '&body=' + escape(body), dataType: 'json', cache: false, headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') }, error :function( errors ) { output = "<div class='alert alert-danger'><h4><i class='icon fa fa-ban'></i> Возникла ошибка</h4><ul>"; $.each(errors.responseJSON, function(index, error){ output += "<li>" + error + "</li>"; }); output += "</ul></div>"; $('#append').html(output); }, success: function(data){ output = "<div class='alert alert-success'><h4><i class='icon fa fa-check'></i> Готово</h4>"; output += data.success; output += "</div>"; $('#append').html(output); setTimeout(function(){ window.location.replace('{{ url('panel/article') }}')}, 3500 ); } }) });