Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-14-2007, 05:38 PM   PM User | #1
figo
New to the CF scene

 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
figo is an unknown quantity at this point
Special characters in a list

Hi all,

My website deals with Chinese characters (http://caractereschinois.free.fr) and I have trouble displaying them in a list.

I used to be able to do it by using innerHTML like for example:
Code:
list.innerHTML = '<option>&#25248 ;</option>';
but it turned out that IE did not like it. However this way of dealing with a special character was correctly displayed with Firefox, Safari and Konqueror.

So I switch to a nicer way of creating options in a list:
Code:
var newOption = new Option('&#25248 ;', 0);
list.options[0] = newOption;
This works with Firefox and IE but it displays &#25248 ; and not the character ( 抠 ).

How would you do?

Thanks,

figo

PS: The text in the option is actually a long string with special characters in formatted with &#/;. I do not really want to have to interfere with the string itself.

PPS: it was really tricky to get this post to be displayed correctly since every html code is interpreted but &amp; ;-). I could have a correct preview by using &# 38 ; instead of &amp; but I could not get it correct after submitting (a first processing turned it into something that was interpreted as the character itself). I have the opposite problem if I write &#25248 ; ) without a whitespace, the smiley is interpreted before the character itself... this all looks like a lot of fun to come...
figo is offline   Reply With Quote
Old 02-15-2007, 07:34 AM   PM User | #2
gunman
New Coder

 
Join Date: Jul 2005
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
gunman is an unknown quantity at this point
Hi, i'll put special characters in a xml file(utf-8 encoded) after that i'll read them with javascript or php and show them.
__________________
If you can not find a decision, maybe you have to try to change a problem

http://www.gunman.co.nr
http://bglinux.org
gunman is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:22 AM.


Advertisement
Log in to turn off these ads.