mickael9
Full Member
Posts: 117 Reputation: 3
33 / /
Joined: Jul 2005
|
RE: HTML entities(?)
code: var htmlentities = {
'"' : '"',
' ' : ' ',
''' : '\'',
'&' : '&',
'\\\'' : '\''
}
String.prototype.htmldecode = function()
{
var sRet = this;
for (var sKey in htmlentities)
{
sRet = sRet.replace(new RegExp(sKey, 'g'), htmlentities[sKey]);
}
return sRet;
}
var decodedText = myText.htmldecode();
This post was edited on 12-04-2006 at 07:18 PM by mickael9.
|
|