Sending form with ajax and php I turn the $_POST in array, and then append do with it, however, the whitespace are converted to \n, where is my mistake?
Updating the page, the \n disappear, but with not append ...
jQuery
$.ajax({
type: "POST",
url: "send.php",
data: dataString,
dataType: 'json',
cache: false,
success: function(mydata) {
}
PHP
// array
$my = array(
'text'=>$text
);
$myJSON = json_encode($my);
echo($myJSON);
HTML OUTPUT
test\n
Aucun commentaire:
Enregistrer un commentaire