this的指向
来源:互联网 发布:mysql while do 编辑:程序博客网 时间:2024/05/16 13:07
1.alert(this) 这里的this指的是window。
2.function fn1(){
alert(this)
}
fn1();
这里的this也是指的window。
3.function fn1(){
alert(this)
}
oBtn.onclick=fn1;这里的this指的是oBtn.因为button触发了函数,一般来说谁触发了函数,this就指向谁。
4.function fn1(){
alert(this)
}
oBtn.onclick=function(){
fn1();
};这里的this指的是window.
0 0
- JS this的指向
- JavaScript-this的指向
- js的this指向
- this对象的指向
- this的指向
- this的指向
- javascript的this指向
- this的指向问题
- javascript this的指向
- 关于this的指向
- this对象的指向
- 关于this的指向
- this的指向
- 修改this的指向
- this 和super的指向
- JS:this关键字的指向
- js中this的指向
- js中this的指向
- 【bzoj1503】[NOI2004]郁闷的出纳员
- 自学hibernate框架以及自己总结的一些经验(一)
- 理解 JMeter 聚合报告(Aggregate Report)
- DM3730开发板使用uboot通过网络下载内核和文件系统 ubuntu下配置 TFTP
- oracle批量为表增删字段
- this的指向
- [IOS APP] 适用于iso9001质量管理体系认证
- 在Android中通过ndk读取本地文件
- 30种提高mysql处理速度的方法
- Windows系统下Java环境变量配置详解
- 红外解码数码管显示
- Python串口模块pySerial
- 重写spring源码达成场景需求,完美升级
- [Boolan] C++第六周