javascript - 在 Opencart 中使用 Javascript 或 JQuery 编码和解码 HTML 实体

标签 javascript jquery opencart

如何使用 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/

相关文章:

javascript - 如何在不打开浏览器的情况下在服务器中运行 Slimmerjs?

javascript - Node.js 在 cmd 中运行,但不在浏览器中运行

jquery - 我怎样才能提高这个jquery动画代码的性能

javascript - 触发 ReactJS 元素的 onClick 事件

size - Opencart缩略图大小

javascript - 来自 JavaScript 的 Opencart 成功订单 ID 和总计

javascript - 如何在processing.js中访问json数据

javascript - 对特定域使用 X-XSS-Protection?

jquery - HTML/CSS 有条件地在页面的特定位置呈现 div

php - 如何通过代码刷新opencart修改