Нет описания

ieTips.html 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  6. <title>兼容信息</title>
  7. <meta name="renderer" content="webkit" />
  8. <link rel="shortcut icon" href="img/favicon.ico" />
  9. <script type="text/javascript">
  10. var versions = IEVersion();
  11. if(versions === -1 || versions === 'edge' || versions === 11 || versions === 10 ){
  12. window.location.href = './login.html';
  13. }
  14. /**
  15. * 判断是否是IE浏览器 版本,包括Edge浏览器(下面是返回值)
  16. * -1 Number 不是ie浏览器
  17. * 6 Number ie版本<=6
  18. * 7 Number ie7
  19. * 8 Number ie8
  20. * 9 Number ie9
  21. * 10 Number ie10
  22. * 11 Number ie11
  23. * 'edge' String ie的edge浏览器
  24. */
  25. function IEVersion() {
  26. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  27. var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
  28. var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
  29. var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
  30. if (isIE) {
  31. var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
  32. reIE.test(userAgent);
  33. var fIEVersion = parseFloat(RegExp["$1"]);
  34. if (fIEVersion == 7) {
  35. return 7;
  36. } else if (fIEVersion == 8) {
  37. return 8;
  38. } else if (fIEVersion == 9) {
  39. return 9;
  40. } else if (fIEVersion == 10) {
  41. return 10;
  42. } else {
  43. return 6; //IE版本<=7
  44. }
  45. } else if (isEdge) {
  46. return 'edge'; //edge
  47. } else if (isIE11) {
  48. return 11; //IE11
  49. } else {
  50. return -1; //不是ie浏览器
  51. }
  52. }
  53. </script>
  54. <style>
  55. body {
  56. background: #FEFEFE;
  57. font-family: "微软雅黑";
  58. }
  59. .IE_content {
  60. width: 580px;
  61. height: 140px;
  62. position: absolute;
  63. top: 50%;
  64. margin-top: -70px;
  65. left: 50%;
  66. margin-left: -290px;
  67. text-align: center;
  68. }
  69. .IE_tips {
  70. font-size: 18px;
  71. }
  72. </style>
  73. </head>
  74. <body>
  75. <div class="IE_content">
  76. <img class="signin_title" src="img/signin_title.png" alt="title" style="display: none;"/>
  77. <p class="IE_tips">为了给您提供更优质的网页浏览体验,建议使用IE10及以上版本的浏览器</p>
  78. </div>
  79. </body>
  80. </html>