判斷瀏覽器版本


使用<!––[if IE]>語句添加升級提示,如
判斷當前瀏覽器是否IE6(或IE6內核)
<!––[if IE 6]>你使用的是IE6瀏覽器,這是IE的過時版本,是時候升級了!<![endif]––>
判斷當前瀏覽器是否IE7及如下版本
<!--[if lte IE 7]>這段文字只會在IE7及(IE7/IE6/IE5等)如下版本顯示<![endif]-->
判斷是否IE
<!––[if IE]>你正在使用的是IE瀏覽器<![endif]––>

應用實例(使用方法:添加在網站頭部代碼</head>以前)
IE8及如下版本提示升級
<!--[if lte IE 8]><script>window.location.href='http://cdn.dmeng.net/upgrade-your-browser.html?referrer='+location.href;</script><![endif]-->
IE7及如下版本提示升級
<!--[if lte IE 7]><script>window.location.href='http://cdn.dmeng.net/upgrade-your-browser.html?referrer='+location.href;</script><![endif]-->
IE6及如下版本提示升級
<!--[if lte IE 6]><script>window.location.href='http://cdn.dmeng.net/upgrade-your-browser.html?referrer='+location.href;</script><![endif]-->
相關文章
相關標籤/搜索