I no longer know what to do with it. I need to get the contents of a post in WordPress and use it in javascript. WordPress returns unscreened text. This is what I copied from the browser.

document.getElementById('qua').innerHTML="<p>Lorem ipsum dolor slksf;lgsit amet, consectetur adipisicing elit, sed do eiusmod<br /> tempor incididuknt ut labore et dolohhhrelk;kllk magnat aliq. Ut enim ad minim veniam,<br /> quis nostrud exercitation ullamcj<br /> is jyuyynisi ut aliquip ex ea commodo<br /> consequat. Duis aute irur dolor in reprehenderit in voluptate velit esse<br /> cillum dolore eu fikugiat nulla pariaturl;. Excepteur sint occaecat cupidatat non<br /> proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p> <a href="http://wordpress/2016/11/04/peppa-pig-playing-in-a-bog/#more-9" class="more-link"><span aria-label="Читать далее Peppa pig playing in a bog">(далее&hellip;)</span></a></p> " 
  • And how do you need to use it in js? - Vadim Leshkevich
  • Well, screen it before output, if you need it. echo addcslashes(get_the_content()); - alenkins
  • I get text in a few lines, but I need to add one or add a backslash to each - Oleh
  • Make a replacement for the translation of lines, add slashes - did not see the problem - mihdan
  • str_replace, addslashes or htmlspecialchars depending on needs - mihdan

0