1

如何使用 Javascript 或 JQuery 编码和解码 HTML 实体?

我使用 ajax 调用,并以 json 格式获取此数据。我在 var Title 中设置。

var Title = "<p>? <span style="color: rgb(0, 0, 0); font-family: Helvetica, Verdana, Geneva, Arial, sans-serif; font-size: 15px;">Bananas have thick inedible skins that turn yellow or red when ripe. As the most popular fruit in the world, they grow on trees in the subtropics and tropics. You can eat some varieties after skinning them, but some are inedible raw</span></p>?"

我希望它是:

varTitle = "Bananas have thick inedible skins that turn yellow or red when ripe. As the most popular fruit in the world, they grow on trees in the subtropics and tropics. You can eat some varieties after skinning them, but some are inedible raw.";

?

4

1 回答 1

0

使用UrlDecode()此功能。也许它会帮助你。

于 2013-02-02T10:28:54.283 回答