How do I get the latest updated typed in value of a textarea and html encode the value.
To get the value I use:
$('textarea').val(); // this works cross browser
But if the value was "sdfgsdgdsgsdg <br/>"
how do I HTML encode it?
It breaks when I stringify()
it
var e = { "d" : $('textarea').val()};
var s = JSON.stringify(e); //it breaks here
"};` does not error (nor is it JSON, it is JavaScript) – Quentin Aug 10 '12 at 12:15