JavaScript determines user IE browser version

Source: Internet
Author: User
Keywords Web page production Ajax javascript
Tags ajax browser browser version document html http ie browser internet

<html>
<head>
<title> to determine the IE version and give the prompts to upgrade the browser </title>
</head>
<style Type= "Text/css" >
#ie6-warning{
Background:rgb (255,255,225) URL ("/upload/201006/20100628012515690.gif") No-repeat Scroll 3PX Center;
Position:absolute;
top:0;
left:0;
font-size:12px;
Color: #333;
width:97%;
padding:2px 15px 2px 23px;
Text-align:left;
}
#ie6-warning a {
Text-decoration:none;
}
</style>
<body>
<!--[if LTE IE 6]>
<div id= "ie6-warning" > You are using the Internet Explorer 6, the display effect on this page may vary. We recommend that you upgrade to <a href= "http://www.microsoft.com/china/windows/internet-explorer/" target= "_blank" >internet Explorer 8</a> or the following browsers: <a href= "http://www.mozillaonline.com/" >firefox</a>/<a href= "http:// WWW.GOOGLE.COM/CHROME/?HL=ZH-CN ">chrome</a>/<a href=" http://www.apple.com.cn/safari/">safari< /a>/<a href= "Http://www.operachina. com >opera</a>
</div>
<script type= "text/javascript" >
function position_fixed (el , Eltop, Elleft) {
//check if this is IE6
if (!window.xmlhttprequest)
Window.onscroll = function () {
El.style.top = (document.documentelement.scrolltop + eltop) + "px";
El.style.left = (document.documentelement.scrollleft + elleft) + px;
}
Else el.style.position = "fixed";
}
Position_fixed (document.getElementById ("ie6-warning"), 0, 0);
</script>
<![ Endif]-->
</body>
</html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.