如何得到IE的版本号

chrisl80 2004-10-12 03:50:13
同标题
...全文
121 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
梅雪香 2004-10-13
  • 打赏
  • 举报
回复
var isIesix=window.clientInformation.appVersion.indexOf("6.0");
if(isIesix==-1) 不是ie6
其它版本同理
BlueDestiny 2004-10-13
  • 打赏
  • 举报
回复
倒~
? :
相当于
if(){

}
else{

}
chrisl80 2004-10-13
  • 打赏
  • 举报
回复
?1:0;
这是什么意思
meizz 2004-10-13
  • 打赏
  • 举报
回复
var ver = window.navigator.appVersion;
alert(parseFloat(ver.substr(ver.indexOf("MSIE")+5))); //version
ttyp 2004-10-12
  • 打赏
  • 举报
回复
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkBrowser()
{
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.mac=(this.ver.indexOf('Mac') > -1) ?1:0;
this.ope=(navigator.userAgent.indexOf('Opera')>-1);
this.ie=(this.ie6 || this.ie5 || this.ie4)
this.ns=(this.ns4 || this.ns5)
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope)
this.nbw=(!this.bw)

return this;
}

var a = new checkBrowser();

if(a.ie6)
{
alert("是IE6");
}
//-->
</SCRIPT>
风斧 2004-10-12
  • 打赏
  • 举报
回复
参考这个
function checkBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.mac=(this.ver.indexOf('Mac') > -1) ?1:0;
this.ope=(navigator.userAgent.indexOf('Opera')>-1);
this.ie=(this.ie6 || this.ie5 || this.ie4)
this.ns=(this.ns4 || this.ns5)
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope)
this.nbw=(!this.bw)
return this}
chrisl80 2004-10-12
  • 打赏
  • 举报
回复
我只想知道是IE5,还是IE6,怎么做
chrisl80 2004-10-12
  • 打赏
  • 举报
回复
返回的值是什么意思
jiangok2002 2004-10-12
  • 打赏
  • 举报
回复
window.clientInformation.appVersion
梅雪香 2004-10-12
  • 打赏
  • 举报
回复
var isIesix=window.clientInformation.appVersion.indexOf("6.0");

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧