<script type="text/javascript"> function Dog(){ this.type="dog"; this.tail=1; this.bark="wangwang"; } var ahuang=new Dog(); //alert(ahuang.bark); with(ahuang){ alert(bark); } </script>
with用于引用某js对象的已有属性
原文:http://www.cnblogs.com/dll-ft/p/5750823.html