关于js中prototype问题 js的prototype问题如果定义一个Person,一个Student,如果让Student继承自Person,那么是不是可以这样写呢:Student.prototype=Person? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function Person(){};Person.propotype={ //....}function Student(){}Student.prototype=new Person();这个是简单的继承 或者说是扩展 搞不清楚隐形原型链__proto__,是永远弄不明白prototype属性的.Student.prototype=Person;表明Student.prototype.__proto__ === Function.prototype那么当你var s = new Student();那么s对象对应的整个链是这样的s.__proto__ === Student.prorotype -> Student.prototype.__proto__ === Function.prototype -> Function.prototype.__proto__ === Object.prototype -> Object.prototype.__proto__ === null你瞧,Person.prototype并未在链中,所以Student并未继承了Person EXTJS 中 xtype : 'panel' 动态数据 怎么实现 js事件取消 javascript能否获得windows的系统进程 求助:history.back()在ie7中的重大问题! 菜鸟学习javaScript求大神们给点意见 如何实现div的“alt”属性? 请各位高手看一下这个脚本要的变量怎么定义?麻烦帮我修改一下 如何给iframe中的一个表单form2的输入框ipt2付值? 搜索不了,只好提问散分!后退到上一页的上一页如何写? 服务器与多页面通讯的问题 求本javascript的书下载地址 关于框架和子页的 readyState
function Person(){};
Person.propotype={
//....
}function Student(){}
Student.prototype=new Person();这个是简单的继承 或者说是扩展
表明
Student.prototype.__proto__ === Function.prototype那么当你
var s = new Student();
那么s对象对应的整个链是这样的s.__proto__ === Student.prorotype -> Student.prototype.__proto__ === Function.prototype -> Function.prototype.__proto__ === Object.prototype -> Object.prototype.__proto__ === null你瞧,Person.prototype并未在链中,所以Student并未继承了Person