使用jQuery打印日语 [英] Print japanese with jQuery

查看:156
本文介绍了使用jQuery打印日语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用jQuery动态地打印一些日语到页面,它不显示任何可识别。我不知道出了什么问题,我把代码减少到最直接,它不解决它。

我使用:

  $('body')。append('< p>日本语< / p>'); 

这应该有效吗?



我得到:

 æ-¥æœ¬ªªž

Huh?

解决方案

您确定网页已设为使用日语字符集?如果没有,请确保您的字符集在< head>< / head> 节点中定义:

 < meta http-equiv =Content-Typecontent =text / html; charset = euc-jp> 


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.

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">

这篇关于使用jQuery打印日语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆