簡體   English   中英

使用Opencart中的Javascript或JQuery編碼和解碼HTML實體

[英]Encode and decode HTML entities using Javascript or JQuery in Opencart

如何使用Javascript或JQuery編碼和解碼HTML實體?

我使用ajax call,並以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()此函數。 可能會對您有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM