javaScript中用ActiveXObject("InternetExplorer.Application")打开IE。

javaScript中用ActiveXObject("InternetExplorer.Application")打开IE。,第1张

出于安全考虑,现在的主流浏览器都是不允许隐藏状态栏的,目的是为了当用户把鼠标悬停在一个超链接上面时能够看到其具体网址,避免在完全不知情的情况下点击进入一个不良网站。目前大概只有IE6才能实现隐藏状态栏的目的了。

<script type="text/javascript">

if(navigatorappName ==

"Microsoft Internet Explorer" && navigatorappVersion

split(";")[1]replace(/[ ]/g,"")=="MSIE60")

{

alert("IE 60");

}

else

if(navigatorappName == "Microsoft Internet Explorer" &&

navigatorappVersion split(";")[1]replace(/[ ]/g,"")=="MSIE70")

{

alert("IE 70");

}

else

if(navigatorappName == "Microsoft Internet Explorer" &&

navigatorappVersion split(";")[1]replace(/[ ]/g,"")=="MSIE80")

{

alert("IE 80");

}

else

if(navigatorappName == "Microsoft Internet Explorer" &&

navigatorappVersion split(";")[1]replace(/[ ]/g,"")=="MSIE90")

{

alert("IE 90");

}

</script>

因为在opera(我的版本是210)下,nav的值是:

"mozilla/50 (windows nt 61; wow64) applewebkit/53736 (khtml, like gecko) chrome/3401847132 safari/53736 opr/210143257 (edition campaign 49)"

按你的表达式顺序首先匹配了chrome,后面不再执行;最终的结果就是

syschrome = 3401847132

sysopera = undefined

单独拿出来时执行了 /opr\/([\d\]+)/ 匹配,所以结果又是正确的。

以上就是关于javaScript中用ActiveXObject("InternetExplorer.Application")打开IE。全部的内容,包括:javaScript中用ActiveXObject("InternetExplorer.Application")打开IE。、使用jquery3.1.1版本,如何判断浏览器为ie8浏览器、javascript 浏览器版本检测时候opera浏览器出问题等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/9516195.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-29
下一篇 2023-04-29

发表评论

登录后才能评论

评论列表(0条)

保存