I have a textarea on a page that I update and set the data in using ajax, but for some reason line breaks are represented by a \n. I've tried server side changing them and client side but no matter what I do I either get a \n in the textarea or a <br /> tag in there.
I have tried using .val(), .text() and .html() to get and set the info.
Any help really appreciated
Thanks
Sorry the code I am using
to update using ajax
var genNotes = $('#MainContent_TxtGenNotes').val();
var param = { notes: genNotes }
$.ajax({
url: "default.aspx/UpdateInfo",
data: JSON.stringify(param),
dataType: "json",
type: "POST",
etc etc
the code I'm using to retrieve
$.ajax({
url: "default.aspx/UserDetails",
data: JSON.stringify(param),
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },
success: function (data) {
try {
var json = JSON.stringify(data);
var json_obj = $.parseJSON(json);
$('#MainContent_TxtGenNotes').html(json_obj[0].genNotes);
etc etc
.val(), then make sure all\nonly have a single backward slash. You can usereplaceto replace all\\nor\\\nwith just a single slash.