<script language="javascript">
var agt=navigator.userAgent.toLowerCase();
var bVer = parseInt(navigator.appVersion);
var IE = (navigator.appName == "Microsoft Internet Explorer") ? true : false;
bVer = (IE && (bVer == 4) && (agt.indexOf("msie 5.0")!=-1) ) ? 5 : bVer;
document.write("您使用的是第 "+bVer+" 版");
</script>
上面是检查版本的 !
var agt=navigator.userAgent.toLowerCase();
var bVer = parseInt(navigator.appVersion);
var IE = (navigator.appName == "Microsoft Internet Explorer") ? true : false;
bVer = (IE && (bVer == 4) && (agt.indexOf("msie 5.0")!=-1) ) ? 5 : bVer;
document.write("您使用的是第 "+bVer+" 版");
</script>
上面是检查版本的 !
function lib_bwcheck(){ //为了提高适用性,必须的除非你打算在一种浏览器中浏览
this.ver=navigator.appVersion;
this.agent=navigator.userAgent
this.dom=document.getElementById?1:0
this.win = (navigator.appVersion.indexOf("Win")>0);
this.xwin = (navigator.appVersion.indexOf("X11")>0);
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ie=this.ie4||this.ie5||this.ie6
this.mac=this.agent.indexOf("Mac")>-1
this.opera5=this.agent.indexOf("Opera 5")>-1
this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom||false);
this.width = null;
this.height = null;
return this
} var bw = new lib_bwcheck();
//比如你用ie4
<a id=update href="www.microsoft.com/ie/***.exe">update IE</a>
if(!bw.ie6)update.onclick()//不符合就下载升级程序,那个程序好像是自动执行的
如果你想执行exe,不指导行不行,没用js做过,你可以做个dll,它有权限执行,让后用get方法提交到dll就可以了
function updateie(){
var newwin=window.open('','','')
newwin.loaction="http://www.microsoft.com/..."
//newwin.close();
}