/*********************************************************************
* 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的更多相关文章

  1. Uncaught TypeError: this.canvas.getContext is not a function

    /**************************************************************************** * Uncaught TypeError: ...

  2. Uncaught TypeError: _react2.default.findDOMNode is not a function

    react 查找某节点时报错 Uncaught TypeError: _react2.default.findDOMNode is not a function 代码: import React, { ...

  3. js Object扩展自定义方法,jQuery抛出 Uncaught TypeError: matchExpr[type].exec is not a function

    使用Jquery的时候,想在Object原型上添加自己扩展的方法的时候,启动项目之后,打开网页就会报如上错误信息,经过测试,可以在Object下的具体类型上进行扩展自定义方法,如String,Arra ...

  4. 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 ...

  5. 使用 jQuery.i18n.properties 实现 Web 前端的国际化

    jQuery.i18n.properties 简介 在介绍 jQuery.i18n.properties 之前,我们先来看一下什么是国际化.国际化英文单词为:Internationalization, ...

  6. jQuery之前端国际化jQuery.i18n.properties

    jQuery.i18n.properties是一款轻量级的jQuery国际化插件,能实现Web前端的国际化. 国际化英文单词为:Internationalization,又称i18n,"i& ...

  7. jQuery之前端国际化jQuery.i18n.properties[转]

    http://www.ibm.com/developerworks/cn/web/1305_hezj_jqueryi18n/ jQuery.i18n.properties是一款轻量级的jQuery国际 ...

  8. jQuery国际化插件 jQuery.i18n.properties 【轻量级】

    jQuery.i18n.properties是一款轻量级的jQuery国际化插件,能实现Web前端的国际化. 国际化英文单词为:Internationalization,又称i18n,“i”为单词的第 ...

  9. Web前端国际化之jQuery.i18n.properties

    Web前端国际化之jQuery.i18n.properties jQuery.i18n.properties介绍 国际化是如今Web应用程序开发过程中的重要一环,jQuery.i18n.propert ...

随机推荐

  1. [转载]Javassist 使用指南(二)

    ======================= 本文转载自简书,感谢原作者!. 原链接如下:https://www.jianshu.com/p/b9b3ff0e1bf8 =============== ...

  2. eclipse 工程没有build path

    项目的.project文件添加: <buildSpec><buildCommand><name>org.eclipse.jdt.core.javabuilder&l ...

  3. jQuery的$.each()遍历checkbox

    $("input[type='checkbox']").each(function(){ var value = $(this).val(); //获得值 $(this).attr ...

  4. LeetCode——Integer Replacement

    Question Given a positive integer n and you can do operations as follow: If n is even, replace n wit ...

  5. LeetCode—— Partition Equal Subset Sum

    Question Given a non-empty array containing only positive integers, find if the array can be partiti ...

  6. Tachyon:Spark生态系统中的分布式内存文件系统

    转自: http://www.csdn.net/article/2015-06-25/2825056  摘要:Tachyon把内存存储的功能从Spark中分离出来, 使Spark可以更专注计算的本身, ...

  7. 解题报告:hdu1008 Elvator

    2017-09-07 19:30:22 writer:pprp 比较顺利,最近生活出现了各种问题, 发生了很多矛盾,我要耐下心来,最重要的不是努力不努力,而是选择 希望我能处理好人际关系还有学业上的压 ...

  8. C#代码实现 Excel表格与Object互相转换,Excel表格导入数据库(.NET2.0 .NET4.0)

    前些天在工作上遇到这个需求,在GitHub找到一个开源代码可以用,Fork了一个版本,整理一下发出来. ①.Net项目中使用Nuget安装一个 NPOI 包    https://github.com ...

  9. c++之单例模式

    1 本篇主要讨论下多线程下的单例模式实现: 首先是 double check 实现方式: 这种模式可以满足多线程环境下,只产生一个实例. template<typename T> clas ...

  10. Entity Framework教程及文章传送门

    Entity Framework视频教程http://www.iqiyi.com/playlist296844502.html Model-Code First做法講解與教學 (ASP.net MVC ...