Strings from JSON response not escaped correctly in HTML markup
I have a JSON response with strings escaped as follows: 24"
escaped as 24"
(no semicolon)
When I write this string to markup with JQuery .text(), 开发者_开发技巧the final result appears as 24&#34
in the generated markup (the &
in 24"
is HTML escaped).
Is there a good way to display this text correclty in the browser (i.e. 24"
instead of 24"
)?
try .html() instead of .text() and the data you are getting is coming from database?
精彩评论