[转]js checkBrowser
时间:2010-10-13 来源:tiechui
<script type= "text/javascript " language= "javascript ">
<!--
function checkBrowser()
{
var ClientInfo= " ";
ClientInfo = ClientInfo + "userAgent : "+window.navigator.userAgent+ " <br> ";
ClientInfo = ClientInfo + "appName : "+window.navigator.appName+ " <br> ";
ClientInfo = ClientInfo + "appVersion : "+window.navigator.appVersion+ " <br> ";
ClientInfo = ClientInfo + "appMinorVersion : "+window.navigator.appMinorVersion+ " <br> ";
ClientInfo = ClientInfo + "appCodeName : "+window.navigator.appCodeName+ " <br> ";
ClientInfo = ClientInfo + "platform : "+window.navigator.platform+ " <br> ";
ClientInfo = ClientInfo + "language : "+window.navigator.language+ " <br> ";
ClientInfo = ClientInfo + "userLanguage : "+window.navigator.userLanguage+ " <br> ";
ClientInfo = ClientInfo + "cpuClass : "+window.navigator.cpuClass+ " <br> ";
ClientInfo = ClientInfo + "onLine : "+window.navigator.onLine+ " <br> ";
//ClientInfo = ClientInfo + "javaEnabled : "+window.navigator.javaEnabled+ " <br> ";
ClientInfo = ClientInfo + "mimeTypes : "+window.navigator.mimeTypes+ " <br> ";
ClientInfo = ClientInfo + "plugins : "+window.navigator.plugins+ " <br> ";
ClientInfo = ClientInfo + "cookieEnabled : "+window.navigator.cookieEnabled+ " <hr> ";
ClientInfo = ClientInfo + "screen.colorDepth : "+window.screen.colorDepth+ " px <br> ";
ClientInfo = ClientInfo + "screen.width : "+window.screen.width+ " px <br> ";
ClientInfo = ClientInfo + "screen.height : "+window.screen.height+ " px <br> ";
ClientInfo = ClientInfo + "screenTop : "+window.screenTop+ " px <br> ";
ClientInfo = ClientInfo + "screenLeft : "+window.screenLeft+ " px <br> ";
ClientInfo = ClientInfo + "screen.availWidth : "+window.screen.availWidth+ " px <br> ";
ClientInfo = ClientInfo + "screen.availHeight : "+window.screen.availHeight+ " px <hr> ";
ClientInfo = ClientInfo + "body.clientWidth : "+document.body.clientWidth+ " px <br> ";
ClientInfo = ClientInfo + "body.clientHeight : "+document.body.clientHeight+ " px <br> ";
ClientInfo = ClientInfo + "body.clientTop : "+document.body.clientTop+ " px <br> ";
ClientInfo = ClientInfo + "body.clientLeft : "+document.body.clientLeft+ " px <hr> ";
ClientInfo = ClientInfo + "body.offsetWidth : "+document.body.offsetWidth+ " px <br> ";
ClientInfo = ClientInfo + "body.offsetHeight : "+document.body.offsetHeight+ " px <br> ";
ClientInfo = ClientInfo + "body.offsetTop : "+document.body.offsetTop+ " px <br> ";
ClientInfo = ClientInfo + "body.offsetLeft : "+document.body.offsetLeft+ " px <hr> ";
ClientInfo = ClientInfo + "body.scrollWidth : "+document.body.scrollWidth+ " px <br> ";
ClientInfo = ClientInfo + "body.scrollHeight : "+document.body.scrollHeight+ " px <br> ";
ClientInfo = ClientInfo + "body.scrollTop : "+document.body.scrollTop+ " px <br> ";
ClientInfo = ClientInfo + "body.scrollLeft : "+document.body.scrollLeft+ " px <hr> ";
ClientInfo = ClientInfo + "div.clientWidth : "+document.getElementById( "Desktop ").clientWidth+ " px <br> ";
ClientInfo = ClientInfo + "div.clientHeight : "+document.getElementById( "Desktop ").clientHeight+ " px <br> ";
ClientInfo = ClientInfo + "div.clientTop : "+document.getElementById( "Desktop ").clientTop+ " px <br> ";
ClientInfo = ClientInfo + "div.clientLeft : "+document.getElementById( "Desktop ").clientLeft+ " px <hr> ";
ClientInfo = ClientInfo + "div.offsetWidth : "+document.getElementById( "Desktop ").offsetWidth+ " px <br> ";
ClientInfo = ClientInfo + "div.offsetHeight : "+document.getElementById( "Desktop ").offsetHeight+ " px <br> ";
ClientInfo = ClientInfo + "div.offsetTop : "+document.getElementById( "Desktop ").offsetTop+ " px <br> ";
ClientInfo = ClientInfo + "div.offsetLeft : "+document.getElementById( "Desktop ").offsetLeft+ " px <hr> ";
ClientInfo = ClientInfo + "div.scrollWidth : "+document.getElementById( "Desktop ").scrollWidth+ " px <br> ";
ClientInfo = ClientInfo + "div.scrollHeight : "+document.getElementById( "Desktop ").scrollHeight+ " px <br> ";
ClientInfo = ClientInfo + "div.scrollTop : "+document.getElementById( "Desktop ").scrollTop+ " px <br> ";
ClientInfo = ClientInfo + "div.scrollLeft : "+document.getElementById( "Desktop ").scrollLeft+ " px <hr> ";
document.getElementById( "Desktop ").innerHTML = ClientInfo;
}
//-->
</script>
<body onLoad= "checkBrowser() ">
<div id= "Desktop "> </div>
</body> </html>