检索用户的浏览器语言 [英] Retrieve the user's browser language

查看:67
本文介绍了检索用户的浏览器语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是来自菲律宾的dharyl,我在了解用户的浏览器语言时遇到了问题。当网站用户使用en-us以外的其他语言时,我被要求弹出警告。

我在下面有这个代码只是为了测试页面应该读取的语言设置来自用户。

Hi Everyone,

I''m dharyl from Philippines, I had a problem in knowing the user''s browser Language. I was asked to have an alert pop up when the user of the site is using other language than "en-us".
I had this code below just to test what language setting should the page read from the user.

展开 | 选择 | Wrap | 行号

推荐答案

您好,欢迎来到TSDN!


大多数浏览器不支持部分或全部这些属性。请参阅此链接
Hi, welcome to TSDN!

Some or all of these properties are not supported by most browsers. See this link.



您好,欢迎来到TSDN!


大多数浏览器都不支持部分或全部这些属性。请参阅此链接



你好,

感谢您的回复。我认为我现在需要的只是让它在IE中运行。

或者我的代码没有其他方法可以知道用户使用的浏览器语言了吗?因为我真的需要解决这个问题。



谢谢,

dharyl


Hi acoder,

Thanks for the reply. I think all I need for now is to make it work in IE.
Or are there no more way for my codes to know what browser language the user is using? Coz I really need solution for this problem.


thanks,
dharyl


如果你想要一个只有IE的解决方案,你可以使用而是ActiveX / vbscript。这允许您在启用正确的安全级别时访问本地设置。
If you want an IE-only solution, you could use ActiveX/vbscript instead. This allows you to access the local settings when the correct security level is enabled.


这篇关于检索用户的浏览器语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆