百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
J

jQuery-Browser-Language

> 编程语言
开源

以有用的方式获取浏览器的语言设置

99 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

以有用的方式获取浏览器的语言设置

Note: this is a hack only to be used if you do not have a back end available that can do this for you. In general you should not be making calls to third party hosted javascript files in your pages unless you have a very high level of trust in the host. Third party script calls could in theory run any arbitrary javascript on your site.

This is a jQuery plugin to obtain the browser language setting

The browser language can not (generally) be obtained via navigator.language (which is silly but there you go).

The browser language is available in "Accept-language" HTTP header, but this is not directly accessible via javascript.

The plugin utilises a service at http://ajaxhttpheaders.appspot.com which echoes back the HTTP request headers in JSONP.

I made that as well, and intend to leave it running there in perpetuity (or as long as Google continue to host App Engine for free)

The Accept-Language header as defined by http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.10 uses an ISO 639-1 language code. The plugin converts this to an English Language description of the Language (e.g. 'Norwegian'), but also returns the complete value of the header if you need to do further processing.

Example usage:

Update 30th April 2015

If you want to run your own version of the App Engine app, you can find it here: https://github.com/dansingerman/app-engine-headers

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言