为什么在构造函数'this'DOMWindow
Why is DOMWindow not defined when the constructor of 'this' is DOMWindow
我试图找到DOMWindow,但它一直说它是未定义的。我怎么得到它?
(function() {
alert(this.constructor); // function DOMWindow() { [native code] }
alert(DOMWindow); // DOMWindow is undefiend
})();
怎么了??
也许你想要的是alert(window)
还是alert(window.constructor)
?DOMWindow
是创建window
的构造函数。
(function() {
alert(this.constructor); // function DOMWindow() { [native code] }
alert(window);
// or...
alert(window.constructor);
})();
// window shows:
// [Object DOMWindow]
// window.constructor shows:
// function DOMWindow() { [native code] }
相关文章:
- $(this).prop('property') vs. this.property
- Twitter Bootstrap typeahead:使用“this”获取上下文/调用元素
- 在另一个函数中使用变量this
- this.router在AngularJS 2中未定义
- reactjs this.refs vs document.getElementById
- JavaScript 中的嵌套函数和 “this” 关键字
- React+Meteor:this.ops返回未定义
- javascript中对象构造函数中的var属性与this.properties
- 函数中this和var之间的区别
- jQuery(this).Pparent().Pparente().Prent().find()在iPad上不起作用
- Understanding Javascript scope with "var that = this&qu
- 定义this.properties或objectName.properties的javascript JSON对象
- Object.prototype using 'this'
- 在JavaScript类型的函数中避免self-this
- 如何使用(this)访问Angular 2 http rxjs catch函数中的对象属性
- Javascript 对象和 this 关键字
- jQuery使用ajax自动完成问题-TypeError:this.source不是函数
- reactjs无法将this.pops传递到react图表列表中
- 为什么在构造函数'this'DOMWindow
- Javascript“this"变量从特定对象切换到DOMWindow