function pp(json) { this.x = (json.x != null) ? json.x : '未知'; this.xx = (json.xx != null) ? json.xx : this.x / 2; }function zz(x){ this.x = x; } zz.prototype = new pp({});
然后
var zz = new zz(50); alert(zz.x + '---' + zz.xx);
alert
显示的数据是 50
和 0
,怎样才能简便的实时更新继承 pp
的 xx
的值?我想要的是 25
。
求解惑
相关分类