js获取浏览器语言(ie、ff、chrome)、contextpath
生活随笔
收集整理的這篇文章主要介紹了
js获取浏览器语言(ie、ff、chrome)、contextpath
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
js獲取瀏覽器語言(ie、ff、chrome)、contextpath var?language_en_us?=?"en-us";?? var?language_zh_cn?=?"zh-cn";?? var?currentLang;?? var?en_lang?=?{?'test.name':?"name",'test.age':?"age"};?? var?zh_lang?=?{?'test.name'':?"名字",'test.age'':?"年齡"};?? var?current_lang_map;?? ?? currentLang?=?navigator.language;?? if(!currentLang)?? ????currentLang?=?navigator.browserLanguage;?? if(currentLang.toLowerCase()?==?language_zh_CN)?? {?? ????current_lang_map?=?zh_lang;??????? }?? else?? {?? ????current_lang_map?=?en_lang;?? }?? ?? dirstr?+=?"<div?id=age'?class='age'>"?+current_lang_map['test.name']+":8"+"</div>";?? //獲取contextpath?? function?getContextPath()?{?? ??var?pathName?=?document.location.pathname;?? ??var?index?=?pathName.substr(1).indexOf("/");?? ??var?result?=?pathName.substr(0,index+1);?? ??return?result;?? } ? posted on 2016-12-07 10:48 玲兒靈 閱讀(...) 評論(...) 編輯 收藏
/js獲取瀏覽器語言(ie、ff、chrome)?
Java代碼??
js獲取上下文路徑(contextPath)?
轉載于:https://www.cnblogs.com/jymz/p/6140273.html
總結
以上是生活随笔為你收集整理的js获取浏览器语言(ie、ff、chrome)、contextpath的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: socket 多线程安全、粘包问题
- 下一篇: (HDU)1491-- Octorber