如何获得ie版本 有个浏览器对象,叫navigator其属性appVersion返回浏览器的平台和版本信息 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var Nu=navigator.userAgent,Na=0; //浏览器信息if(Nu.indexOf("Chrome")>=0){ Na=1;}else if(Nu.indexOf("Firefox")>=0){ Na=2;}else if(/.+MSIE (\d+)\.0.+/.test(Nu)){ Na=Nu.replace(/.+MSIE (\d)\.0.+/,"$1");} 楼上回答的很好,详细情况上 google 上 百度 一下.相信你会得到更好的解答,呵呵 学习……写个比较无聊的实现方式……<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>无标题文档</title></head><body><script type="text/javascript">var version = "";</script><!--[if IE 6]><script type="text/javascript">version = "ie6";</script><![endif]--><!--[if IE 7]><script type="text/javascript">version = "ie7";</script><![endif]--><script type="text/javascript">alert(version);</script></body></html> 请问楼上<!--[if IE 6]>这是什么 1.在body里定义该控件(如下): <BODY STYLE="behavior:url(#default#clientCaps)" ID="oClientCaps"> 2.判断是否有JVM oClientCaps.isComponentInstalled("{08B0E5C0-4FCB-11CF-AAA5-00401C608500}","componentid") 3.判断jvm是否可用: oClientCaps.JavaEnabled MSDN上的例子(http://msdn.microsoft.com/workshop/author/behaviors/reference/behaviors/clientcaps.asp): <SCRIPT> function window.onload() { var sVersion = oClientCaps.getComponentVersion ("{89820200-ECBD-11CF-8B85-00AA005B4383}","componentid"); myText.innerHTML = "<FONT SIZE=4>You are running Internet Explorer " + sVersion + ".</FONT>"; } </SCRIPT> <BODY BGCOLOR="#FFFFFF" STYLE="behavior:url(#default#clientCaps)" ID="oClientCaps"> <DIV ID="myText"></DIV> chrome扩展,如何获得当前页面的指定元素值? radio单选按钮用图片替代在Chrome浏览器中不显示 求一款网页编辑器,只要能提供SQL语法加亮 批量删除 js正则表达式问题 请帮忙关于javascript错误 我怎样才能将值付给<input type="file" name="dd">的文本框? 提交后返回值是空,怎么才能得到我选择的值呢? 关于this的问题 jQuery template 输出 HTML问题 关于JavaScript验证问题 各位,网上我没有找到JS+CSS的模态对话框,要求是居中的,并且改变IE的大小,还是居中,帮忙啊
if(Nu.indexOf("Chrome")>=0){
Na=1;
}else if(Nu.indexOf("Firefox")>=0){
Na=2;
}else if(/.+MSIE (\d+)\.0.+/.test(Nu)){
Na=Nu.replace(/.+MSIE (\d)\.0.+/,"$1");
}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title></head>
<body>
<script type="text/javascript">
var version = "";
</script>
<!--[if IE 6]>
<script type="text/javascript">
version = "ie6";
</script>
<![endif]-->
<!--[if IE 7]>
<script type="text/javascript">
version = "ie7";
</script>
<![endif]-->
<script type="text/javascript">
alert(version);
</script>
</body>
</html>
这是什么
<BODY STYLE="behavior:url(#default#clientCaps)" ID="oClientCaps">
2.判断是否有JVM
oClientCaps.isComponentInstalled("{08B0E5C0-4FCB-11CF-AAA5-00401C608500}","componentid")
3.判断jvm是否可用:
oClientCaps.JavaEnabled
MSDN上的例子(http://msdn.microsoft.com/workshop/author/behaviors/reference/behaviors/clientcaps.asp):
<SCRIPT>
function window.onload()
{
var sVersion = oClientCaps.getComponentVersion ("{89820200-ECBD-11CF-8B85-00AA005B4383}","componentid");
myText.innerHTML = "<FONT SIZE=4>You are running Internet Explorer " + sVersion + ".</FONT>";
}
</SCRIPT> <BODY BGCOLOR="#FFFFFF" STYLE="behavior:url(#default#clientCaps)" ID="oClientCaps">
<DIV ID="myText"></DIV>