You are here: Re: How to convert HTML special characters to the real characters with a Java script « PHP Programming Language « IT news, forums, messages
Re: How to convert HTML special characters to the real characters with a Java script

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;
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация