function fn1(){
this
}
1. fn1() //this指的是window
2. oDiv.οnclick=fn1 //this指的是oDiv
3. oDiv.οnclick=function(){
fn1() //fn1()里的this指的是window
}
4. <div οnclick="fn1()"></div> //fn1()里的 this指的是window
window.οnlοad=function(){
var ali=document.GetElementByTagName('li')
var that =null
for(var i=0;i<ali.length;i++){
ali[i].οnmοuseοver=function(){
that=this
}
}
function fn1(){
that.getElementByTagName('div')[0].style.display='block'
}
}
this
}
1. fn1() //this指的是window
2. oDiv.οnclick=fn1 //this指的是oDiv
3. oDiv.οnclick=function(){
fn1() //fn1()里的this指的是window
}
4. <div οnclick="fn1()"></div> //fn1()里的 this指的是window
window.οnlοad=function(){
var ali=document.GetElementByTagName('li')
var that =null
for(var i=0;i<ali.length;i++){
ali[i].οnmοuseοver=function(){
that=this
}
}
function fn1(){
that.getElementByTagName('div')[0].style.display='block'
}
}