/* 这个是一个类 */ function xx(num,str) { //说明 var a = num; this.aa = a; this.bb = function(){alert(str);} this.cc = function(){for(var i=0;i<10;i++){document.title=i;}} } xx.prototype.dd= function(){ alert("dd"); } var a = new xx(100,"hello"),b=new xx(0,"ttyp"); eval("a.aa=20"); a.bb(); b.dd(); alert(a.aa);