开发者

Print japanese with jQuery

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜