ブラウザのバージョンの判断
//
<script>
if(navigator.userAgent.indexOf("MSIE")>0){ // IE
if(navigator.userAgent.indexOf("MSIE 6.0")>0){ //6.0 1.CSS
Css.innerHTML='<link href="1.css" rel="stylesheet" type="text/css" >'
}
if(navigator.userAgent.indexOf("MSIE 7.0")>0){//7.0 2.CSS
Css.innerHTML='<link href="2.css" rel="stylesheet" type="text/css" >'
}
}else{// 3.CSS navigator.userAgent
Css.innerHTML='<link href="3.css" rel="stylesheet" type="text/css" >'
}
</script>
//
<script>
function valie()
{
if(window.ActiveXObject){
alert("ie----"+window.ActiveXObject);
}
if(window.XMLHttpRequest){
alert(" ie------"+window.XMLHttpRequest);
}
}
function chk()
{
if (navigator.appName.indexOf("Microsoft") != -1) {
alert("ie");
} else {
alert(" ");
}
}
</script>
ネット収集整理