如何使用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.";
答案 0 :(得分:1)
使用UrlDecode()
这个功能。可能会帮助你。