Js judge IE browser version is too low sample code

  • 2020-03-29 23:58:22
  • OfStack

A very simple example to determine if the version of Internet explorer is too low
The structure of the example is as follows. In fact, one page plus the introduction of jquery is enough, and a standard structure is created by the way (notice that the prompt effect of IE6 and IE7 is not seen until the version is lower).
< img SRC = "border = 0 / / files.jb51.net/file_images/article/201311/201311221642081.gif? 20131022164231 ">  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<title> detection IE Whether the browser version is too low </title> 
<script type="text/javascript" src="js/jquery.min.js"></script> 
<script type="text/javascript"> 
$(document).ready(function() {s 
var b_name = navigator.appName; 
var b_version = navigator.appVersion; 
var version = b_version.split(";"); 
var trim_version = version[1].replace(/[ ]/g, ""); 
if (b_name == "Microsoft Internet Explorer") { 
if (trim_version == "MSIE7.0" || trim_version == "MSIE6.0") { 
alert("IE Browser version is too low, please go to the specified website to download the relevant version "); 
//Then go to the download site you want to connect to

Related articles: