The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

kiltubrid (1) [Avatar] Offline
#1
Will the below code ADD the show method to Item? Don't believe we want to change the Item class?
See http://encytemedia.com/blog/articles/2006/05/23/prototype-inheritance-madness

var Picture=Class.create();
Picture.prototype=Object.extend(
Item.prototype, /* shb new Item() */
{
initialize:function(name,date,url,dimensions,weight,keywords){
this._init(name,date,keywords);
...
},
show: function() {....}
...
}
davecrane (149) [Avatar] Offline
#2
Re: Problem with inheritence. Chapter 8?
Yes, you're right - thanks for pointing it out! I'd fixed it in snippet 8.11 already, but not in the earlier reference.

Dave