类似代码:
function MyWindow(title,w,h)
{
document.onkeydown=function(e){
this.close();//这里不对,该怎么调成员方法,我写成this.close也不对,我就是想调下的方法,怎么写?
}
this.close=function(){
//.....
}
}
function MyWindow(title,w,h)
{
document.onkeydown=function(e){
this.close();//这里不对,该怎么调成员方法,我写成this.close也不对,我就是想调下的方法,怎么写?
}
this.close=function(){
//.....
}
}
{
var _this = this;
document.onkeydown=function(e){
this.close();//这里不对,该怎么调成员方法,我写成this.close也不对,我就是想调下的方法,怎么写?
}
_this.close=function(){
//.....
}
}
{
var _this = this;
document.onkeydown=function(e){
_this.close();//这里不对,该怎么调成员方法,我写成this.close也不对,我就是想调下的方法,怎么写?
}
this.close=function(){
//.....
}
}第一次的错了。