日期:2014-05-16 浏览次数:20340 次
function getLang(callback) { //debugger; var node = document.createElement("script"); if (node.addEventListener) { node.addEventListener("load", callback, false); } else { node.onreadystatechange = function() { if (this.readyState == "loaded") callback.call(this); } } var wn=window.navigator; if (wn.systemLanguage=="zh-cn" || wn.language=="zh-CN") { node.type = "text/javascript"; node.src = "http://counter.csdn.net/a/js/AreaCounter.js"; } else if (wn.systemLanguage=="zh-tw" || wn.language=="zh-TW") { node.type = "text/javascript"; node.src = "http://counter.csdn.net/a/js/AreaCounter.js"; alert('tw'); } else if (wn.systemLanguage=="en" || wn.language=="zh-EN") { alert('en'); node.src = "http://counter.csdn.net/a/js/AreaCounter.js"; } document.getElementsByTagName("head").item(0).appendChild(node); node = null; }
------解决方案--------------------
var SysLan = window.navigator.systemLanguage; if(SysLan == "zh-cn")window.location = "http://www.baidu.com"; if(SysLan == "en-us")window.location = "index.php?id=471"; // JS代码是没问题的 你的location路径不对 应该是绝对路径
------解决方案--------------------
var wn=window.navigator;
if (wn.systemLanguage=="zh-cn" || wn.language=="zh-CN") {
window.location.href = "index.php?id=191";
}else if (wn.systemLanguage=="en" || wn.language=="zh-EN") {
window.location.href = "index.php?id=471";
} else{
window.location.href = "index.php?id=191";//默认中文页面
}
------解决方案--------------------
一般都是浏览器自己判断的
------解决方案--------------------
mark
------解决方案--------------------
mark it
------解决方案--------------------
Request.ServerVariables("OS");
------解决方案--------------------
<script type="text/javascript"> document.write(navigator.browserLanguage+'<br>'); document.write(navigator.platform+'<br>'); document.write(navigator.cookieEnabled+'<br>'); document.write(navigator.cpuClass+'<br>'); document.write(navigator.onLine+'<br>'); document.write(navigator.platform+'<br>'); document.write(navigator.systemLanguage+'<br>'); document.write(navigator.userAgent+'&