JavaScript基礎知識-Unicode編碼表


            JavaScript基礎知識-Unicode編碼表

                                          作者:尹正傑

版權聲明:原創作品,謝絕轉載!否則將追究法律責任。

 

  Unicode的編碼表也被稱為萬國碼,里面包含了各種字符編碼(https://www.unicode.org/charts/)。

 

一.JavaScript源代碼

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Unicode編碼表</title>
        <script type="text/javascript">
            /**
             *     在字符串中使用轉義字符輸入Unicode編碼,"\u"四位十進制編碼。
             */
            console.log("\u2620");
            console.log("\u2680");
            console.log("\u2681");
            console.log("\u2682");
            console.log("\u2683");
            console.log("\u2684");
            console.log("\u2685");
            console.log("\u2660");
            console.log("\u2661");
            console.log("\u2662");
            console.log("\u2663");
        </script>
    </head>
    <body>
        <!--
            在網頁中使用Unicode編碼,"&#編碼;"這里的編碼需要的是10進制。
        -->
        <h1 style="font-size: 50px;">&#9824;</h1>
        <h1 style="font-size: 50px;">&#9825;</h1>
        <h1 style="font-size: 50px;">&#9826;</h1>
        <h1 style="font-size: 50px;">&#9827;</h1>
    </body>
</html>

 

二.瀏覽器打開以上代碼渲染結果

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM