×ðÁú¿­Ê±¹ÙÍøµÇ¼

jsÖÐÔõôÌí¼ÓÐÄÇé·ûºÅ

ÔÚ javascript ÖÐÌí¼ÓÐÄÇé·ûºÅÓÐÒÔÏÂÒªÁ죺ʹÓà string.fromcodepoint() ½¨Éè×Ö·û´®Ê¹Óà html ʵÌåÌåÏÖÐÄÇé·ûºÅʹÓà unicode ÌÓÒÝÐòÁÐÌåÏÖ×Ö·ûʹרÐÄÇé·ûºÅ¿â½¨Éè×Ô½ç˵ÐÄÇé·ûºÅ

ÔõÑùÔÚ JavaScript ÖÐÌí¼ÓÐÄÇé·ûºÅ

ÔÚ JavaScript ÖÐÌí¼ÓÐÄÇé·ûºÅµÄÒªÁìÈçÏ£º

1. ʹÓà String.fromCodePoint()

String.fromCodePoint() ÒªÁìÔÊÐíÄú´Ó Unicode ×Ö·ûµã½¨Éè×Ö·û´®£¬°üÀ¨ÐÄÇé·ûºÅ¡£ÀýÈ磺

const emoji = String.fromCodePoint(0x1F600); // ?
console.log(emoji); // ?

µÇ¼ºó¸´ÖÆ

2. ʹÓà HTML ʵÌå

Äú¿ÉÒÔʹÓà HTML ʵÌåÀ´ÌåÏÖÐÄÇé·ûºÅ¡£HTML ʵÌåÊÇÌØÊâ×Ö·û£¬¿ÉÒÔת»»ÎªÏìÓ¦µÄ×Ö·û¡£ÀýÈ磺

const emoji = "& #128512;"; // ?
console.log(emoji); // ?

µÇ¼ºó¸´ÖÆ

3. ʹÓà Unicode ÌÓÒÝÐòÁÐ

Unicode ÌÓÒÝÐòÁÐÊÇʹÓ÷´Ð±¸Ü (`) ºÍÊ®Áù½øÖÆ´úÂëÌåÏÖ×Ö·ûµÄÒªÁì¡£Äú¿ÉÒÔÔÚ JavaScript ÖÐʹÓÃËüÃÇÀ´ÌåÏÖÐÄÇé·ûºÅ¡£ÀýÈ磺

const emoji = "\uD83D\uDE00"; // ?
console.log(emoji); // ?

µÇ¼ºó¸´ÖÆ

4. ʹרÐÄÇé·ûºÅ¿â

ÓÐÐí¶àÐÄÇé·ûºÅ¿â¿É¹©ÓÃÓÚ JavaScript¡£ËüÃÇÌṩÁËÒ»¸ö¿ÉÒÔÇáËÉ»á¼ûºÍʹÓõÄÐÄÇé·ûºÅÜöÝÍ¡£Ò»Ð©Ê¢ÐеĿâ°üÀ¨£º

[emojione](https://emojione.com/)

[Twemoji](https://github.com/twitter/twemoji)

[JoyPixels](https://www.joypixels.com/)

5. ½¨Éè×Ô½ç˵ÐÄÇé·ûºÅ

Äú»¹¿ÉÒÔ½¨Éè×Ô¼ºµÄ×Ô½ç˵ÐÄÇé·ûºÅ¡£Îª´Ë£¬ÄúÐèҪʹÓÃͼÏñ±à¼­Èí¼þ½¨ÉèÒ»¸öͼÏñ£¬È»ºó½«Æäת»»Îª WebP »ò PNG µÈÃûÌá£È»ºó£¬Äú¿ÉÒÔʹÓà Image ¹¤¾ß½«ÆäÌí¼Óµ½ÄúµÄ JavaScript ´úÂëÖС£

ÒÔÉϾÍÊÇjsÖÐÔõôÌí¼ÓÐÄÇé·ûºÅµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ