Hello. I just can not understand what the problem is.

There is a div which contains the text of the description of the news.

<div id="my_html_content">Содержимое с <b>HTML</b> тегами и всем что может быть&nbsp;еще.</div> 

Screwed this divym tinymce with the ability to inline the output of the editor and save. In general, when saved in the editor, save_onsavecallback is called, which in turn calls my function ajax_save_news in which the argument is the contents of the diva obtained with

 tinymce.get("my_html_content").getContent() 

Actually the function that makes the promise

 function ajax_save_news(news_content) { $.ajax({ url:"ajax_action.php?action=ajax_save_news&news_id="+NEWS_ID, type:"post", dataType:"html", data:"news_content=" + news_content, success:function(return_data) { alert(return_data); } }); } 

Everything would be fine, only here as a result I cut html. In the console, the data is still whole, but with php already broken content.

I can not understand what the problem is. It turns out that stumbles on unbreakable spaces and the like in the content. I tried all sorts of manipulations with the functions of screening, but apparently not.

UPD: An example of the text that is sent from the diva (this is already with the html content that is in the editor in the admin)

 <p>Премьер-министр Израиля Биньямин Нетаньяху <br />поручил МИД подготовить выход страны из ЮНЕСКО. <br />Как сообщает&nbsp;Haaretz со ссылкой на пресс-службу <br />премьера, Нетаньяху приветствовал решение США <br />выйти из ЮНЕСКО, отметив, что Вашингтон поступил <br />смело.</p> 

And when I receive in $ _POST, I only

 Премьер-министр Израиля Биньямин Нетаньяху поручил МИД подготовить выход страны из ЮНЕСКО. Как сообщает 
  • "when printing php already broken content" like this? Show PHP code. - E_p
  • @E_p added sample text. There is nothing in PHP, just print. Here I do not correctly send the data itself apparently. But I can not understand what is wrong. - Evgeny
  • Check post_max_size in php.ini - E_p
  • Did you see in dev tools (chrome / firefox / ie ...) what exactly is going to the server? - E_p
  • and what means receipt through $ _POST? Where is a piece of code that outputs to div when getting from Ajax? - Jean-Claude

0