转义问题

  function HTMLDecode(text) {    var temp = document.createElement("div");    temp.innerHTML = text;    var output = temp.innerText || temp.textContent;    temp = null;    return output;} 

  var detail = '${articleContent!''}';
  alert(HTMLDecode(detail));  
    
    document.getElementById("content").innerHTML = HTMLDecode(detail)

猜你喜欢

转载自blog.csdn.net/weixin_34183910/article/details/87675255
今日推荐