<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>个人测试</title>
</head>
<body onload="load()">
<div id="content" >
<div>
<label id="label_username"></label>
<input type="text" id="button-login"></input>
</div>
<div>
<label id="label_password"></label>
<input type="password" id="label-username"></input>
</div>
<input type="button" id="label-password"/>
</div>
</body>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.i18n.properties-min-1.0.9.js"></script>
<script type="text/javascript">
function load(){ $(function(){
jQuery.i18n.properties({
name : 'strings', //资源文件名称
path : '/i18n/', //资源文件路径
mode : 'map', //用Map的方式使用资源文件中的值
language:'en',
callback : function() {//加载成功后设置显示内容
alert($.i18n.prop('like'));
$('#button-login').value=$.i18n.prop('home');
$('#label-username').html($.i18n.prop('like'));
}
});
});}
</script>
</html>
代码是网上找的,但是无法显示资源文件里的键值。alert一下,显示[like],文件里的是Like。那位大神解答一下。还有获取中文的时候乱码。