javascript - php echo alert message with new line '\n' not working -
i have message show using alert()
$message = "no result found following info:name: ".$fullname."ic: ".$id." in database."; echo "<script>alert('".$message."'); window.history.back();</script>";
this working if add new line '\n' message
$message = "no result found following info:\nname: ".$fullname."\nic: ".$id." in database.";
it not show out pop out message. problem?
edit not change newline in php, instead in javascript:
'no result found following info:\nname: '.$fullname.'\nic: '.$id.' in database.' ^ ^ ^ ^ ^ ^
or adding backslash: "\\n"
.
according panther, truth: use 'alert("' . $message . '")'
.