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 . '")'.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -