Setting dynamically the Greek charset in Firefox ?

Giganews Newsgroups
Subject: Setting dynamically the Greek charset in Firefox ?
Posted by:  Julien (j.a.rouill…@gmail.com)
Date: Thu, 15 Nov 2007

Hi,

Trying to set dynamically the charset in an inline framed document, I
observed that the following script works in MSIE but not in Firefox. I
thought that document.charset was more universal...
Any idea what I can do?

<head>  /* This is in the inline framed document */
  (skip)
  <script language="JavaScript" type="text/javascript"><!--
    if (document.frames.parent.lang=='el')  /* if parent document is
in Greek language */
        {document.charset='iso-8859-7';}  /* Has no effect in Firefox
2.0 */
    else
        {charset='iso-8859-1';}  /* Use latin-1 character set if
content not in Greek */
  </script>
</head>

Thanks.

N.B.: I need to set the charset dynamically. I cannot use a <meta>
markup.

Replies