How to use JavaScript to decode from:
\u003cb\u003estring\u003c/b\u003e
to
<b>string</b>
(I searched in internet, there are some site with same question, such as:
Javascript html decoding
or
How to decode HTML entities
but it dont have same encode fomat)
Thank you very much!
This is a dup of How do I decode a string with escaped unicode?. One of the answers given there should work:
var x = '\\u003cb\\u003estring\\u003c/b\\u003e';
JSON.parse('"' + x + '"')
Output:
'<b>string</b>'