欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOCX文档下载  

    jQueryi18nproperties开发指南.docx

    • 资源ID:3061460       资源大小:37.54KB        全文页数:4页
    • 资源格式: DOCX        下载积分:6.99金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要6.99金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    jQueryi18nproperties开发指南.docx

    jQueryi18nproperties开发指南jQuery.i18n.properties开发指南 jQuery.i18n.properties是jQuery的一个插件,可以通过properties文件为JavaScript提供国际化的支持。 jQuery.i18n.properties可以根据给定的Locale和国家代码的组合),加载并解析指定的properties文件,从而实现国际化。 jQuery.i18n.properties首先加载默认的properties文件,然后再加载指定Locale的properties文件。 properties文件的内容是与Locale相关的key/value对。示例如下: Messages.properties: # This line is ignored by the plugin msg_hello = Hello msg_world = World msg_complex = Good morning 0! Messages_zh.properties: # We only provide a translation for the 'msg_hello' key msg_hello = 你好 Messages_zh_CN.properties: # We only provide a translation for the 'msg_hello' key msg_hello = 你好 在页面中使用jQuery.i18n.properties时,首先要应用jQuery和jQuery.i18n.properties包 <scripttype="text/javascript"language="JavaScript" src="js/jquery.2.1.4-min.js"></script> <scripttype="text/javascript"language="JavaScript" src="js/jquery.i18n.properties-min.js"></script> 其次,初始化jQuery.i18n.properties以加载properties文件如下: jQuery.i18n.properties( name:'Messages', /properties文件名为Messages.properties path:'bundle/', /properties文件位于本js文件的当前目录的bundle子目录下 mode:'map', language:'zh_CN', callback:function ); 补充:初始化jQuery.i18n.properties的参数列表 Option Description Notes Optional, String or String name Partial name (or names) of files representing resource bundles (eg, Messages or 'Msg1','Msg2'). Defaults to 'Messages' language ISO-639 Language code and, optionally, ISO-3166 country code (eg, en, en_US, zh_CN). If not specified, language reported by the browser will be used instead. Optional, String path Path to directory that contains .properties files to load. Optional, String mode Option to have resource bundle keys available as Javascript vars/functions OR as a map. The map option is mandatory if your bundle keys contain Javascript Reserved Words. Possible options: vars (default), map or both. Whether bundles should be cached by the browser, or forcibly reloaded on each page load. Defaults to false (i.e. forcibly reloaded). The encoding to request for bundles. Property file resource bundles are specified to be in ISO-8859-1 format. Defaults to UTF-8 for backward compatibility. Optional, String cache Optional, boolean encoding Optional, String callback Callback function to be called upon script execution completion. Optional, function 然后就可以在页面中使用如下: / Accessing a simple value through the map jQuery.i18n.prop('msg_hello'); / Accessing a value with placeholders through the map jQuery.i18n.prop('msg_complex', 'John'); 注意:jQuery.i18n.properties的使用,必须将应用部署到服务器,通过服务器访问页面。直接通过文件系统访问页面将无法正确加载,因为浏览器存在对XMLHttpRequest跨域访问的限制。 参考文献:

    注意事项

    本文(jQueryi18nproperties开发指南.docx)为本站会员(牧羊曲112)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开