Comments on: Object Extension http://mattsnider.com/languages/javascript/object-extension/ Understanding JavaScript and Frameworks Mon, 13 Oct 2008 19:02:55 +0000 http://wordpress.org/?v=2.1.2 By: Brad Harris http://mattsnider.com/languages/javascript/object-extension/#comment-7179 Brad Harris Wed, 12 Mar 2008 20:20:44 +0000 http://mattsnider.com/languages/javascript/object-extension/#comment-7179 Great explanation, thanks. I've used the YIU extension method a bit, and am now working on something where I'm trying to accomplish the same extending mechanism in jQuery. I've hit a bit of a brick wall in that yui provides you with a superclass attribute on your subclass, which lets you call the constructor of that superclass. I can't seem to find a way to accomplish this using jQuery.extend(), without creating something myself (may have to). I'd love to know if you know of a way to do that in jQuery, or tips on a good approach to wrap that functionality up. Great explanation, thanks. I’ve used the YIU extension method a bit, and am now working on something where I’m trying to accomplish the same extending mechanism in jQuery. I’ve hit a bit of a brick wall in that yui provides you with a superclass attribute on your subclass, which lets you call the constructor of that superclass. I can’t seem to find a way to accomplish this using jQuery.extend(), without creating something myself (may have to). I’d love to know if you know of a way to do that in jQuery, or tips on a good approach to wrap that functionality up.

]]>
By: Matt Snider http://mattsnider.com/languages/javascript/object-extension/#comment-7403 Matt Snider Sat, 15 Mar 2008 18:23:13 +0000 http://mattsnider.com/languages/javascript/object-extension/#comment-7403 Brad, JQuery extend instead really meant to be used for Class hierarchy. It is used to augment an Object with additional methods. Instead, I would just use the method that I wrote, with super class support: http://mattsnider.com/javascript/improving-extend-with-super/ Brad, JQuery extend instead really meant to be used for Class hierarchy. It is used to augment an Object with additional methods.

Instead, I would just use the method that I wrote, with super class support:

http://mattsnider.com/javascript/improving-extend-with-super/

]]>
By: Brad Harris http://mattsnider.com/languages/javascript/object-extension/#comment-7404 Brad Harris Sat, 15 Mar 2008 18:35:11 +0000 http://mattsnider.com/languages/javascript/object-extension/#comment-7404 Thanks for responding. After some effort, I ended up using your extend method. It worked out great, and I think its a lot more intuitive to call this.parent.xxx() instead of having to dig into a prototype anyways. Thanks again! Thanks for responding. After some effort, I ended up using your extend method. It worked out great, and I think its a lot more intuitive to call this.parent.xxx() instead of having to dig into a prototype anyways. Thanks again!

]]>