0
4

2 回答 2

1

Need to use HTML entities to display those characters:

http://www.danshort.com/HTMLentities/

That would be ‘ I believe.

To do the encoding, since you're already using jQuery you could use this method to encode the paragraph element's text

于 2013-04-11T01:18:16.410 回答
1

I'm pretty sure this isn't an issue with the ajax request or any of the JavaScript. In fact, you don't need to include the "contentType" option in your call to .ajax(). Also, it's not a question of "escaping" but of "encoding." You need the server to properly encode the response so it is UTF-8. The server should also set the "Content-Type" response header to "text/html; charset=utf-8". First you could check what the response headers look like for the ajax response. But even if they are correct, that does not mean that the response was actually encoded properly. You'd have to check your server code to see what it is doing.

于 2013-04-11T01:34:48.377 回答