Please help, when sending a JavaScript variable containing HTML code, using the post method ajax
var text = "<span style = 'color: red;'></span>"; $.ajax({ url: "edit.php", type: "POST", datatype: "html", data: ({text}), success: div_edit }); <? $text = $_POST["text"]; echo $text; // в index.php выводится это <span style = "\"color:" red;\"></span> ?> <span style = 'color: red;'></span> turns into
<span style = "\"color:" red;\"></span> How can this be prevented? Code:
$textvariable? - andreymal"<span style = 'color: red;'></span>"- Drakonoved“\”cannot turn out from these quotes, the author still does not finish speaking - andreymal