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 ...
随机推荐
- sql server 数据字典的妙用
以下提到的一些需求,你可能会说用SQL server management studio 客户端 看一下不就可以了,何必这么麻烦 ! 是的,当1 个表的时候我们可以人工检查,但当有10 个表,100个 ...
- UVA 1213 Sum of Different Primes(经典dp)
题意:选择k(k<15)个唯一质数,求出和为n(n<1121)的可能数 题解:预处理dp,dp[k][n]表示使用k个素数拼成n的总方案数 就是三重枚举,枚举k,枚举n,枚举小于n的素数 ...
- [Network Architecture]ResNext论文笔记(转)
文章地址: https://blog.csdn.net/u014380165/article/details/71667916 论文:Aggregated Residual Transformatio ...
- Python学习札记(九) Basic6 dict and set
参考:dict and set Note: A.dict Hint:注意最后三点. 1.Python内置字典dict,全称directory,在别的语言如C++中称为map,使用键值-value存储, ...
- MySQL 乐观锁 悲观锁 共享锁 排他锁
乐观锁 乐观锁是逻辑概念上的锁,不是数据库自带的,需要我们自己去实现.乐观锁是指操作数据库时(更新操作),想法很乐观,认为这次的操作不会导致冲突,在操作数据时,并不进行任何其他的特殊处理(也就是不加锁 ...
- git tags 管理
新建标签: git tag -a V1.1 -m "some thing" (新建标签前请先commit代码) 推送标签: git push --tags (推送标签前请先推送代码 ...
- 尽量不要使用using namespace std
C++标准程序库中的所有标识符都被定义于一个名为std的namespace中. namespace是指标识符的各种可见范围.命名空间用关键字namespace 来定义.命名空间是C++的一种机制,用来 ...
- 使用idea引入注解@SpringBootApplication报错Cannot resolve symbol 'SpringBootApplication'
我在使用idea时,在类上使用注解@SpringBootApplication,但是一直报错. Cannot resolve symbol 'SpringBootApplication' 网络上有很多 ...
- LeetCode 525. Contiguous Array
525. Contiguous Array Add to List Description Submission Solutions Total Accepted: 2476 Total Submis ...
- 【hive】解析url格式字符串
解析url格式字符串 parse_url() parse_url(url_str,’xxx’):第一个参数是url格式字符串,第二个参数为要解析出来的属性 parse_url(‘http://face ...