???????????????????

??????????????????????????????????????C++??C#??Java??????????顣 ?????????????????У?????????????????? - ???????? ????????????﹫????????????????????????????????????? ????????????????????????????????? - ???????к?????

??????????JavaScript???????У????е?????????????????????? ???JavaScript???????????????????????????????????? ?????????Щ??????????????JavaScript??????????????? ??????????????顢?????????????????????????????????????

var doc; //?????????doc????
doc=(function(){
var _d;
 function doc(){
 this._d=window.document;
}
 doc.prototype.echo=function(){
  this._d.write("hell world");
  return 1;
 } //?????????????echo
 return doc;
})();

????????

var mydoc=new doc();
mydoc.echo(); //????????hell world

???????JavaScript???????

/*
* ??????????
* ???????2012-10-18
* ????????120715852@qq.com
*/
//???typescript ?·
var __extends = this.__extends || function(a??b){
 function __(){ this.constructor=a;}
 __.prototype=b.prototype;
 a.prototype=new __();
}

???????????????????????? - ????prototype???????????????prototype???????????棬?′????????????????????棨prototype??????????? ??????????????????????????????????????????????????о??????????????

????????????

//DocMulit ???doc
var DocMulit=(function(_doc){
 __extends(DocMulit??_doc);
 var txt??but;
 function DocMulit(){
  _doc.call(this);
  txt= this._d.createElement("input");
  but=this._d.createElement("button");
  but.innerText="????????";
  but.onclick=function(){
  if(txt.value=='') {
  txt.focus(); //console.log(txt);
  }else{
   var doc_p=new DocP(txt.value);
   doc_p.echo();
  }
  }
 }
//??д????? echo ?????
 DocMulit.prototype.echo=function(){
  _doc.prototype.echo.call(this);//????????echo????
  this._d.body.appendChild(txt);
  this._d.body.appendChild(but);
 }
 return DocMulit;
})(doc);
//DocP ???doc
var DocP=(function(_doc){
 __extends(DocP??_doc);
 var p_tar;
 function DocP(tar){
  _doc.call(this);
  this._d=window.document;
  this.p_tar=this._d.createElement("p");
  this.p_tar.innerText=tar;
  this.p_tar.setAttribute("title"??"Click here of delete");
  this.p_tar.setAttribute("style"??"cursor:pointer;");
  this.p_tar.onclick=function(){
   if(confirm('You are delete?')){
    window.document.body.removeChild(this);
   }
  }
 }
//??д?????echo????
 DocP.prototype.echo=function(){
  this._d.body.appendChild(this.p_tar);
 }
 return DocP;
})(doc);
//?????doc?????DocMulit
var mydoc=new DocMulit();
mydoc.echo();

????????????????Ч??