简体   繁体   中英

Encode/Decode string in JavaScript

i have string, have got from database, it's equal Ivory Coast(Cote D'Ivoire) , then this string displayed with javaScript. And get next result: Ivory Coast(Cote D'Ivoire) . The ' character was converted! How to resolve this problev in JavaScript?

PS I haven't written code for you because i don't think it can help you in this case! My question clear without it.

Thanks!

Unescape HTML entities in Javascript? .

This link help me! In my case I have wrote the next code:

$('#messageText').html(message).text();

where #messageText a div container, that must contain a message, message my string Ivory Coast(Cote D'Ivoire) . It work fine!

PS Thanks everybody for helping! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM