how to code   in UTF-8 ...??

W

WEB 1040

Hi,

I've created a javascript file that inserts a nav bar at the bottom of a
page with a doc.write statement. because some of my pages are multi-lingual
(ie, greek etc), when I use UTF-8 as content-type stmt, the non-breaking
spaces ( ) in my javascript statements show up as a series of
question-marks when rendered by IE6.

any way around this?

thanks for any comments...

G
 
J

Jukka K. Korpela

WEB 1040 said:
I've created a javascript file that inserts a nav bar at the bottom
of a page with a doc.write statement.

That sounds absurd, but it might actually be useful if your all pages
contain normal static links to relevant pages (such as upwards in
hierarchy, to a page that contains an index of pages). Then the
"navigation menu" on each page would not disturb people who are careful
enough to keep JavaScript disabled.
when I use UTF-8 as content-type
stmt, the non-breaking spaces ( ) in my javascript statements
show up as a series of question-marks when rendered by IE6.

Is your page actually UTF-8 encoded, and why do you use the entity
reference instead of the real no-break space character in _generated_
markup? And where is your JavaScript code? If embedded into HTML inside
a <script> element or in an attribute, then &nbsp; _might or might not_
be converted to no-break space by the browser in parsing, depending on
the browser used and HTML version.

In any case, you are creating unnecessary problems. If we knew the
original problem, which made you try to generate stuff client-side,
someone might suggest a simple, nice, and robust approach.
 
A

Aquila Deus

WEB said:
Hi,

I've created a javascript file that inserts a nav bar at the bottom of a
page with a doc.write statement. because some of my pages are multi-lingual
(ie, greek etc), when I use UTF-8 as content-type stmt, the non-breaking
spaces (&nbsp;) in my javascript statements show up as a series of
question-marks when rendered by IE6.

any way around this?

"&nbsp;" in iso-8869-1 is exactly as same as it in utf8. Can it show
correctly in mozilla/firefox?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top