ITeye博客

javascript misc

floydd · 2007-12-22 15:09 · Markdown

function ChatTransport(win){
this.cc=1

this.test1=function(){
this.test11()
}
this.test11=function(){
alert(this.cc)
}
this.test2=function(){
test22();
}
var test22=function(){
alert(this.cc)
}

}

var ct = new ChatTransport();
ct.test1();
ct.test2();

js中的私有方法(用var定义的,非this)是取不到公有属性(this定义的属性)的

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。