声明:如非注明原创,则本blog所发日志为引用,向原创作者致意!敬礼!
佛曰: 人生最大的财富是健康
佛曰: 人生最大的幸福是放得下
站点公告
最新日志
博文评论
博客留言
博客登陆
博文搜索
博客信息
收藏连接
 
javascript 实现继承,重载
janedong 发表于 2006/6/2 11:20:00

test.js

//define a class named myObject inherited from Object

function myObject(){

_mp = myObject.prototype = new Object();

//define an attribute "text"

_mp.text = "this is a text";

}

test.aspx,

//call "myObject" in the script block

var aa = new inHeritClass;

//belowing is the value from the watch window

- _mp {...} Object
 text "this is a text" String


 inHeritClass {...} Object


- aa = new inHeritClass {...} Object
 text "this is a text" String

发表评论:

    昵称:
    密码:
    主页:
    标题: