It's inherently unsafe/insecure to randomly unescape HTML content unless you know where its coming from (fully).
In any case:
unescape('%3ch1%3eMy System%3c/h1%3e') = "<h1>My System</h1>"
質問
I have a textarea from I got the value like this $(ctrl).val() then I receive this %3ch1%3eMy System%3c/h1%3e so I've been trying to encode this value into this:
<h1>My System</h1>
But I don't know how.
I found on internet many examples like this
jQuery('<div />').html('Some text with <div>html</div>').text()
But no success! The decode text is different.
解決
It's inherently unsafe/insecure to randomly unescape HTML content unless you know where its coming from (fully).
In any case:
unescape('%3ch1%3eMy System%3c/h1%3e') = "<h1>My System</h1>"