Help needed with simple Java script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nela

    #1

    Help needed with simple Java script

    Hello everyone, from Croatia !

    I am designing a site for a Serbian client, and the english page is ok, but
    the serbian page needs to be cyrillic. It was no problem for Photoshop
    design, but I inserted a little greeting in java (found free online), good
    morning, good afternoon... This is part of the code:

    hours = today.getHours( );
    if (hours<12) greeting = 'Good morning!';
    if (hours<18 && hours>11) greeting = 'Good afternoon!';

    For example:

    ????? ?????
    ????? ?????
    ????? ???

    I would like those greetings to show on the page in cyrillic writing, font
    name is ArialCYR to be exact. How do I tell Java to display cyrillic ???
    I don't have experience with classes etc, so not sure
    Thanks ! (if you wish to see, the site is radgost-scl.com)

    Nela.



  • Joshua Cranmer

    #2
    Re: Help needed with simple Java script

    nela wrote:
    Hello everyone, from Croatia !
    >
    I am designing a site for a Serbian client, and the english page is ok, but
    the serbian page needs to be cyrillic. It was no problem for Photoshop
    design, but I inserted a little greeting in java (found free online), good
    morning, good afternoon... This is part of the code:
    >
    hours = today.getHours( );
    if (hours<12) greeting = 'Good morning!';
    if (hours<18 && hours>11) greeting = 'Good afternoon!';
    >
    For example:
    >
    ????? ?????
    ????? ?????
    ????? ???
    >
    I would like those greetings to show on the page in cyrillic writing, font
    name is ArialCYR to be exact. How do I tell Java to display cyrillic ???
    I don't have experience with classes etc, so not sure
    Thanks ! (if you wish to see, the site is radgost-scl.com)
    >
    Nela.
    >
    >
    >
    Looking at the source of your web page, you're using JavaScript, not
    Java, so you should be using the comp.lang.javas cript newsgroup (that's
    where I set the followup-to field).

    Anyways, if you just put the text in like this:

    greeting = '¸æçè éêëìí îïðñòóôõö÷øùú Ûüýþÿ';

    it should work. However, the server is currently sending the file as
    Windows-1250, when it should be Windows-1251 or UTF-8 (or any other
    encoding capable of supporting Cyrillic characters), so without changing
    the file encoding, the text would become gibberish (????, e.g.). Please
    don't ask me how to do that, because it is quite system-dependent.

    Comment

    Working...