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定义的属性)的