So here's my problem:
This line replaces only the first "\n" spec. character in my textarea, and this way everything's screwed up... I'm sending the replaced content of the textarea through AJAX to the server, in a GET method.
I've tried to just comment out this line to see whether this is necesarry, but then no "\n" is transferred at all... I'm using a PHP server side, and that works.
Or maybe should I split up the value of the textarea by "\n", and GET it to the server, and then write it out line by line?
Do you mean, that I should define the content variable outside of this function? Like on the beginning of the js file, and not in the AJAX method?
First, you have used a string ("\n") instead of a regexp (/\n/) in the string.replace function. Second, string.replace will replace only the first occurrence of the pattern in the string unless the global flag is used. If you use a proper regexp and include the global flag, (/\n/g), you should find all NLs replaced as you desire.
My only problem is that there aren't so many hungarian translations... Because I'm not a pro in english, I prefer learning it it on my mother language. It'd be really nice if I'd find a good translation of a RegExp book, or something... Anything... That's why I'm asking stuff here...
Anyway, Thank you! Problem solved