js
<html><head lang="en"> <meta charset="UTF-8"> <title></title> <script> // window // 1.所有的全局变量都是它的属性 // 2.所有的全局函数/对象都是它的函数/对象 // console.log(age); // console.log(window.age); // function sum(){ // var age = 30; // console.log(window.age); // } // sum(); // window.sum(); // alert('hhhh'); // window.alert('哈哈哈哈'); // console.log('hhhhhhhh'); // window.console.log('和好好好好'); // function Dog(){ // console.log(this); // } // 普通的函数调用 // Dog(); // 构造函数 // var dog1 = new Dog(); // window的另外用法 // js实现动态跳转 // window.location.href = 'http://baidu.com'; alert(0); // location.href = 'http://www.520it.com'; </script> </head> <body> </body></html>