Javascript Html Decoding
When I receive html text by ajax in asp.net application it looks like: <span%20style='color:green;font-weight:bold'>%20Text%20Msg</span> how is it poss
Solution 1:
Nice function here that does it for you - http://phpjs.org/functions/htmlspecialchars_decode:427
Solution 2:
You are probably best suited with finding a server side solution as already mentioned in the comments, since this seems like a server side problem.
If you for some reason wish to do this client side anyway, here is a solution:
var str = "<span%20style='color:green;font-weight:bold'>%20Text%20Msg</span>";
var fixedStr = decodeURIComponent(str).replace(/</g,'<').replace(/>/g,'>');
Post a Comment for "Javascript Html Decoding"