Jquery檢測低版本瀏覽器提示相關信息的實現代碼片段,以下代碼為項目開發中的片段,實現方法思路僅供參考。
//低版本瀏覽器提示
(function () {
var b_name = navigator.appName;
var b_version = navigator.appVersion;
var version = b_version.split(";");
if (b_name == "Microsoft Internet Explorer") {
var trim_version = version[1].replace(/[ ]/g, "");
/*如果是IE6或者IE7*/
if (trim_version == "MSIE7.0" || trim_version == "MSIE6.0" || trim_version == "MSIE8.0" || trim_version == "MSIE9.0" || trim_version == "MSIE10.0") {
getBrowserNoticeDomNew();
}
}
})();
//低版本瀏覽器提示
(function () {
var b_name = navigator.appName;
var b_version = navigator.appVersion;
var version = b_version.split(";");
if (b_name == "Microsoft Internet Explorer") {
var trim_version = version[1].replace(/[ ]/g, "");
/*如果是IE6或者IE7*/
if (trim_version == "MSIE7.0" || trim_version == "MSIE6.0" || trim_version == "MSIE8.0" || trim_version == "MSIE9.0" || trim_version == "MSIE10.0") {
getBrowserNoticeDomNew();
}
}
})();