JavaScript treats newlines as \n, however, when submitting a form via HTTP, JavaScript has nothing to do with it (other than checking the text). Windows treats newlines as \r\n, so when you use Windows and press the return key in the text field, it actually enters \r\nthe field. When you send this data to the server, JavaScript does not do this (unless you use Ajax), your browser does this. Your browser will use the same parameter for newlines as your OS, and why you see them in your PHP file, but not in JavaScript. Different operating systems handle newlines differently. See here for more information.
Edit
. : " ", " " ( ) " ".