Forgive my newbieness... Referencing this posit: jQuery convert line breaks to br (nl2br equivalent)
how do I marry
function nl2br (str, is_xhtml) {
var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2');
}
or
textAreaContent=textAreaContent.replace(/\n/g,"<br>");
into my existing function:
$(document).ready(function() {
$.ajax({
url : "Notes_copy.txt",
dataType: "text",
success : function (data) {
$("#NotesTxtBx").html(data);
}
});
});
what is my textAreaContent in the above example for instance
Thanks so much
")); to actually catch the line breaks in the txt file – Pawel Oct 04 '13 at 21:11