<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author"> <meta name="copyright"> <title>判断浏览器</title> <script> var browser = navigator.userAgent.toUpperCase(); if(browser.indexOf(‘CHROME‘) != -1){ console.log(‘chrome‘) }else if(browser.indexOf(‘FIREFOX‘) != -1){ console.log(‘Firefox‘) }else if(browser.indexOf(‘MSIE 7.0‘) != -1){ console.log(‘MSIE 7.0‘) } </script> </head> <body> </body> </html>
时间: 2024-10-29 17:11:31