如何使用 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.";
?
最佳答案
使用UrlDecode()
这个函数。也许它会对你有所帮助。
关于javascript - 在 Opencart 中使用 Javascript 或 JQuery 编码和解码 HTML 实体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14660794/