Hello!
The server generates a string in the form of html code. For example:
$html = '<div class="cats"></div>'; Can this data be sent as JSON?
Using:
echo json_encode($html); It turns out:
"<\/div>" '; Ca...">
$html = '<div class="cats"></div>'; $a = json_encode($html); $b = json_decode($a); print_r($b); At the output in the $b variable, we have '<div class="cats"></div>'; On the receive side, use json_decode . Checked here
Source: https://ru.stackoverflow.com/questions/536959/
All Articles
ajax,post,getif it is jquery. - Naumovresult.htmlwill return acceptable text. - Naumov