var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];});
var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];});
本文标题:2018-04-26将后台传回的转义字符转换成正常的html标签
本文链接:https://www.haomeiwen.com/subject/ynaplftx.html
网友评论