对象Object下的属性和方法

javascript对象Object下的属性和方法 <script type="text/javascript"> function AClass(){ var obj=new Object(); obj.name='lvhui.org'; obj.get=function(){ alert("get") } obj.post=function(){ alert("post") } return obj;//返回出去的是对象 } var a=AClass();//a成为对象,可以调用方法和属性啦 a.get(); a.post(); alert(a.name); </script>

posted @ 2014-03-28 15:58  杜峰峰  阅读(189)  评论(0编辑  收藏  举报