Posted by Chung Leong on 03/22/06 02:36
Stefan Mueller wrote:
> Therefore I need a Java script function with translates
> äöüÄÖÜçéàè"'
> to
> äöüÄÖÜçéàè"'
>
> In PHP I could do that with the function
> html_entity_decode()
>
> But how can I do it with a Java script?
> Stefan
>
> PS: html_entity_decode() is the opposite of htmlentities(). It converts all
> HTML entities to their applicable characters from string.
This relies on IE extensions but you can it's possible to make it
standard compatible.
function html_entity_decode(s) {
var span = document.createElement('SPAN');
span.innerHTML = s;
return span.innerText;
}
[Back to original message]
|