BOM的其他对象
BOM常用对象和方法:
- window.navigator.userAgent,用户浏览器
- location,用window.location.href="https://www.baidu.com";进行页面调整
- window.location.reload()全局刷新,尽量少用,刷新用局部刷新
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>BOM常用对象和方法</title> </head> <body> <script type="text/javascript"> <!--返回浏览器用户设置信息--> console.log(window.navigator.userAgent); console.log(window.location); //经常用于页面跳转 window.location.href="https://www.baidu.com"; //全局刷新 window.location.reload() </script> </body> </html>