理清浏览器Window对象&window对象&this对象
2016-07-17 16:22
232 查看
<!DOCTYPE html> <html> <head> <title>chrome</title> </head> <body> <script type="text/javascript"> console.log(Window); //构造函数Window,由浏览器内核原生代码实现 [native code] try{ ww = new Window(); //Window对象无法直接在JS脚本中实例化 } catch(error){ console.log(error); // TypeError (native) } console.log(this.constructor == Window); //true,浏览器this对象,指向一个Window对象 console.log(this); //瞅瞅Window对象提供了哪些属性和方法供开发者使用 console.log(window == this); //true console.log(this.window == this); //true,window即this.window与this指向同一个Window对象 </script> </body> </html>
相关文章推荐
- 01-分数规划专题
- Qt之事件系统
- Qt之事件系统
- Github上star和fork比较高的vim配置方案
- javascript正则表达式 —— RegExp 对象
- 逆波兰式与表达式求值
- Leetcode-binary-tree-postorder-traversal
- java 集合框架
- 设计模式-创建型-简单工厂模式(Static Factory)
- 集合容器set
- USACO3.2.6 香甜的黄油 (SPFA)
- HDU 4993 / BC 9A Revenge of ex-Euclid
- Java学习--Jsp简介
- Code review
- HDU 1107 武林(大模拟)
- iOS开发 UITextFild/TextView限制字数(含联想词汇)
- 递归和阶乘
- Hadoop集群监控:jmx信息获取
- Android studio 使用Gradle发布Android开源项目到JCenter 总结
- UVA 1149 bin packing (贪心)