[Javascript] special characters and alert box......

Josiah Gordon jgordon at directfile.com
Fri Jun 1 16:28:22 CDT 2001


Lori,

> ...wondering if you found how to put special
> characters in an alert box.


Try using hexadecimal encoding of the upper 128 characters. You can find a
chart here:

http://www.jimprice.com/jim-asc.htm#controlcodes

Usage is like this:

<script>
u = "\xf6"
alert(u) // outputs "ö" [an o with an umlaut]
</script>

This works on all Windows platforms (and all browser types that follow the
ECMA standard for Javascript). You can use unicode conversions (\uXXXX ,
where X is a number) to supposedly have this work on all platforms. I
haven't tried unicode though.

Hope that helps,

Josiah Gordon





More information about the Javascript mailing list