carpinteyrofvo
New Member
through queries to a Database I am retrieving such data that I previously inserted through HTML \[code\]textarea\[/code\] or \[code\]input\[/code\]. When I get the response from my DB , in a \[code\]JSON\[/code\] object the \[code\]text\[/code\] field looks like this : \[code\] obj : { text : [some_text] ? [some_text] }\[/code\]I tried to replace with this \[code\]function\[/code\] :\[code\] string_convert = function(string){ return string.replace("↵",'<br>') .replace('&crarr','<br>') .replace('/[\n\r]/g','<br>'); }\[/code\]I have to show this string in HTML ,but it does not seems to work. I'm using \[code\]UTF-8\[/code\] Any advice?