随笔 - 6, 文章 - 4, 评论 - 0, 引用 - 0
数据加载中……

javascript对象的各种方法

function asd(){
 this.cc=function(){
  alert('ccc');
 };
 
 function privat(){
  alert('私有方法');
 }
 privat();
 
};
asd.dd=function(){
  alert('dd');
 };
 asd.prototype={
 aa : 'aa',
 bb : function(){
  alert(this.aa);
 }
 
};
//asd.prototype.bb();
var sub=new asd();
sub.bb();  // 继承的父对象的prototype的方法
sub.cc();  // 公有方法
asd.dd();   //静态方法 ^_^

posted on 2008-07-28 13:56 小石~~ 阅读(155) 评论(0)  编辑  收藏 所属分类: javascript笔记


只有注册用户登录后才能发表评论。


网站导航: