jQuery EasyUI 国际化
1、自定义jquery国际化插件jquery.international.js,用来初始化国际化用到的变量
// plugin definition $.fn.international = function(options) { // Extend our default options with those provided. // Note that the first arg to extend is an empty object - // this is to keep from overriding our "defaults" object. var opts = $.extend({}, $.fn.international.defaults, options); // Our plugin implementation code goes here. }; // plugin defaults - added as a property on our plugin function $.fn.international.defaults = { foreground: 'red', background: 'yellow' };
2、引入第一步的文件
<script src="<%=request.getContextPath()%>/js/jquery-easyui-1.2.6/plugins/jquery.international.js" charset="UTF-8" type="text/javascript"></script>
3、分别在中文和英文语言包中设置变量的值
easyui-lang-zh_CN.js
$.fn.international.defaults.foreground="红色";
easyui-lang-en.js
$.fn.international.defaults.foreground="red";
4、动态引入语言包文件,见我的上一篇博客
jQuery动态加载js,设置cookie
相关推荐
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20
83510998 2020-07-18
81463166 2020-07-17