Uncaught TypeError: jQuery.i18n.browserLang is not a function
/*********************************************************************
* Uncaught TypeError: jQuery.i18n.browserLang is not a function
* 说明:
* 使用jQuery.i18n.properties.js来做语言自动转换,结果函数无效,读
* 了一下插件源代码,发现已经换掉了接口名称、功能。
*
* 2017-8-31 深圳 龙华樟坑村 曾剑锋
********************************************************************/ 一、参考文档:
. jQuery.i18n.properties.js
https://github.com/jquery-i18n-properties/jquery-i18n-properties/blob/master/jquery.i18n.properties.js 二、查看、分析源代码:
. 确实已经没有了browserLang处理函数了;
. 取而代之的是:
$.i18n.normaliseLanguageCode = function (settings) {
var lang = settings.language;
...
}
. 如上,需要传递一个json格式数据,有language字段;
. 处理方式:
function nav_language_change(obj) {
var language = ""; if (obj == undefined ) {
language = $.i18n.normaliseLanguageCode({"language" : ""});
} else {
language = obj.innerHTML.toString();
$.i18n.normaliseLanguageCode({"language": language});
} current_language = language; // This will initialize the plugin
// and show two dialog boxes: one with the text "Olá World"
// and other with the text "Good morning John!"
// How to dynamically change language using jquery-i18n-properties and JavaScript?
// https://stackoverflow.com/questions/15637059/how-to-dynamically-change-language-using-jquery-i18n-properties-and-javascript
jQuery.i18n.properties({
name:'lang',
path:'language/',
mode:'both',
language: language,
async: true,
callback: function() {
...
}
});
}
. 不同版本,需要不同的调整;
Uncaught TypeError: jQuery.i18n.browserLang is not a function的更多相关文章
- Uncaught TypeError: this.canvas.getContext is not a function
/**************************************************************************** * Uncaught TypeError: ...
- Uncaught TypeError: _react2.default.findDOMNode is not a function
react 查找某节点时报错 Uncaught TypeError: _react2.default.findDOMNode is not a function 代码: import React, { ...
- js Object扩展自定义方法,jQuery抛出 Uncaught TypeError: matchExpr[type].exec is not a function
使用Jquery的时候,想在Object原型上添加自己扩展的方法的时候,启动项目之后,打开网页就会报如上错误信息,经过测试,可以在Object下的具体类型上进行扩展自定义方法,如String,Arra ...
- Uncaught TypeError: _react2.default.createContext is not a function
question is caused by react version, update your react version, it will be ok. use "npm update ...
- 使用 jQuery.i18n.properties 实现 Web 前端的国际化
jQuery.i18n.properties 简介 在介绍 jQuery.i18n.properties 之前,我们先来看一下什么是国际化.国际化英文单词为:Internationalization, ...
- jQuery之前端国际化jQuery.i18n.properties
jQuery.i18n.properties是一款轻量级的jQuery国际化插件,能实现Web前端的国际化. 国际化英文单词为:Internationalization,又称i18n,"i& ...
- jQuery之前端国际化jQuery.i18n.properties[转]
http://www.ibm.com/developerworks/cn/web/1305_hezj_jqueryi18n/ jQuery.i18n.properties是一款轻量级的jQuery国际 ...
- jQuery国际化插件 jQuery.i18n.properties 【轻量级】
jQuery.i18n.properties是一款轻量级的jQuery国际化插件,能实现Web前端的国际化. 国际化英文单词为:Internationalization,又称i18n,“i”为单词的第 ...
- Web前端国际化之jQuery.i18n.properties
Web前端国际化之jQuery.i18n.properties jQuery.i18n.properties介绍 国际化是如今Web应用程序开发过程中的重要一环,jQuery.i18n.propert ...
随机推荐
- centos7更改主机名
操作环境 [root@centos701 ~]# uname Linux [root@centos701 ~]# uname -a Linux centos701 3.10.0-693.el7.x86 ...
- Spring Container的扩展点
转自: http://blog.csdn.net/kkdelta/article/details/5488430 Spring在解析完配置文件后,会调用一些callback方法,使用Spring的开发 ...
- java -jar 启动jar包 带参数
运行jar包时指定端口:java -jar xxx.jar --server.port=8088 server.port=8081 若命令行传入的server.port没有作用,服务仍然使用8081端 ...
- 《Django By Example》
<Django By Example>第六章 中文 翻译 (个人学习,渣翻) 书籍出处:https://www.packtpub.com/web-development/django-ex ...
- 如何将本地的项目上传到git
如何将本地的项目上传到git 1 进入项目文件夹,把目录变为git仓库 git init 2 把文件添加到版本库中 git add . 3 把版本提交到版本库 git commit -m 'first ...
- 数据可视化——matplotlib(2)
导入相关模块 import matplotlib.pyplot as plt import numpy as np import pandas as pd 图表设置 添加X.Y轴标签以及图标标题 a ...
- Java默认提供的线程池
Java的线程池都是通过ThreadPoolExecutor来构建. public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, ...
- 搭建etcd集群
一 介绍 etcd 高可用一致性键值存储系统,使用Raft一直算法处理日志复制以保证数据一致性.主要在搭建kubernates时关注到etcd来研究部署etcd.使用golang语言编写,和zooke ...
- 获得Python脚本所在目录
如何获得Python脚本所在目录的位置 On this page... (hide) 1. 以前的方法 2. 正确的方法 3. 实例说明 (Edit) 1. 以前的方法 如果是要获得程 ...
- WIN10局域网共享,经常出现无法访问的现象的解决方法
WIN10的局域网共享是真操蛋啊,用着好好的,重启了一下,突然就不好用了,其他人无法访问我的电脑,百度了半天也没有找到能解决的访问,文章中说的都试过了,该开启的也都开启了,防火墙也关了,没用,后来想着 ...