2012年1月30日
摘要: 测试代码:function Dog(name) { this.name = name; Dog.prototype = { shout: function() { alert("I am " + this.name); } };}var dog1 = new Dog("Dog 1");dog1.shout();上面的代码看起来很“优美”,可一运行,却报错:“Object doesn’t support this property or method”. 对于代码:Fn() {};var fn = new Fn();new Fn() 的实际构造过程可以等价 阅读全文
posted @ 2012-01-30 18:10 落叶满长沙 阅读(351) 评论(0) 推荐(0) 编辑