Accented Characters and Ligatures in HTML and JavaScript

您所在的位置:网站首页 驾照考试太黑了 Accented Characters and Ligatures in HTML and JavaScript

Accented Characters and Ligatures in HTML and JavaScript

2024-05-31 13:35| 来源: 网络整理| 查看: 265

decodeURI with a suitable argument; e.g. ñ is decodeURI('%C3%B1') Example 1: Here is a test for the capital letter U-umlaut (Ü): document.write('\xDC') // document.write('Ü') // document.write('Ü') // document.write(unescape('%DC')) // document.write(decodeURI('%C3%9C')) // Example 2: Here is a test for the Latin OE ligature (Œ): document.write('\u0152') // document.write('Œ') // document.write('Œ') // document.write(unescape('%u0152')) // document.write(decodeURI('%C5%92')) //

To display an accented character in a JavaScript alert message or a confirm dialog box, use the hexadecimal code of the character, for example:

alert('\xC5ngstr\xF6m is a unit of length.') //Try it!

The following table lists the HTML entities, character codes, and URL-encodings for accented Latin letters and ligatures. (Letters that do not have standard HTML entities are not included. Still, those letters can be rendered, similar to the above examples, as long as you know the character codes \xXX or \uXXXX or &#XXX; e.g. the letters č and ℓ can be rendered using č and ℓ respectively.) See also Greek letters, Mathematical symbols and URL-encoding.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3