日期:2014-05-16 浏览次数:20429 次
<script> function box(){ var user; this.getuser=function(){ return user; }; box.prototype.setuser=function(value){ user=value; }; } var b1=new box(); var b2=new box(); var b3=new box(); b1.setuser('www'); alert(b1.getuser()); alert(b2.getuser()); alert(b3.getuser()); </script>