Here you can find the source of unescapeHtmlEntities()
// Place your application-specific JavaScript functions and classes here // This file is automatically included by javascript_include_tag :defaults // Unescape HTML entities String.prototype.unescapeHtmlEntities = function () { try{//from ww w . jav a 2 s . com var temp = document.createElement('textarea'); temp.innerHTML = this; return temp.value; }catch(e){ return this; } }
String.prototype.unescapeHTML = function() { return String(this).replace("&", "&").replace("<", "<").replace(">", ">").replace('"', '"').replace(''', "'").replace('/', "/");
String.prototype.unescapeHtml = function () { var temp = document.createElement("div"); temp.innerHTML = this; var result = temp.childNodes.length === 0 ? "" : temp.childNodes[0].nodeValue; if(temp.firstChild) temp.removeChild(temp.firstChild); return result; };
String.prototype.unescapeHtml = function () { var temp = document.createElement("div"); temp.innerHTML = this; var result = ""; for (var i = 0; i < temp.childNodes.length; i++) { result = result + temp.childNodes[i].nodeValue; temp.removeChild(temp.firstChild) return result; ...
String.prototype.unescapeHtml = function () { var temp = document.createElement("div"); temp.innerHTML = this; var result = temp.childNodes.length === 0 ? "" : temp.childNodes[0].nodeValue; if(temp.firstChild) temp.removeChild(temp.firstChild); return result; };
String.prototype.unescapeHtml = function () { var temp = document.createElement("div"); temp.innerHTML = this; var result = temp.childNodes[0].nodeValue; temp.removeChild(temp.firstChild); return result;
String.prototype.unescapeHtmlEntities = function () { try{ var temp = document.createElement('textarea'); temp.innerHTML = this; return temp.value; }catch(e){ return this;