开发者

Print japanese with jQuery

开发者 https://www.devze.com 2023-01-14 14:41 出处:网络
I\'m trying to print some Japanese to a page dynamically using jQuery, and it display nothing recognizable. I don\'t know what went wrong, I reduced the code to the most straight-forward, and it doesn

I'm trying to print some Japanese to a page dynamically using jQuery, and it display nothing recognizable. I don't know what went wrong, I reduced the code to the most straight-forward, and it doesn't fix it. Or maybe it's just me being thick开发者_JAVA技巧.

I use:

$('body').append('<p>日本語</p>');

Which should work, right?

And I get:

日本語

Huh?


Have you made sure that your page is set to use the Japanese character set? If not, make sure that your charset is defined in your <head></head> node :

<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">


In some cases Utf-8 character set would be helpful. Add this in your Head node as below.

<head>
    <meta charset="utf-8" />
</head>
0

精彩评论

暂无评论...
验证码 换一张
取 消