Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #12805

Re: Adding new method to existing object

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From cezary.tomczyk@gmail.com
Newsgroups comp.lang.javascript
Subject Re: Adding new method to existing object
Date Fri, 16 Mar 2012 10:18:10 -0700 (PDT)
Organization http://groups.google.com
Lines 36
Message-ID <10224075.1379.1331918290476.JavaMail.geo-discussion-forums@yniz5> (permalink)
References <31786995.22.1331895413978.JavaMail.geo-discussion-forums@vbat19> <571e5767-fc18-4945-b356-4004af1145e8@q12g2000yqg.googlegroups.com>
NNTP-Posting-Host 79.175.205.52
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1331919164 19822 127.0.0.1 (16 Mar 2012 17:32:44 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Fri, 16 Mar 2012 17:32:44 +0000 (UTC)
In-Reply-To <571e5767-fc18-4945-b356-4004af1145e8@q12g2000yqg.googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=79.175.205.52; posting-account=fqiM0AoAAACu3aIqzAK2xf9RRpymvKVH
User-Agent G2/1.0
X-Received-Bytes 2683
Xref csiph.com comp.lang.javascript:12805

Show key headers only | View raw


W dniu piątek, 16 marca 2012, 12:50:39 UTC+1 użytkownik David Mark napisał:
> On Mar 16, 6:56 am, cezary.tomc...@gmail.com wrote:
> > Hi,
> >
> > I want to extend my prototype object using another object. Just created some example code:
> >
> > http://jsfiddle.net/u9e7R/13/
> >
> > I tested the addMethod function in Firefox 10,11, Chrome 17 and IE 9. But it will fail in IE8. In IE8 console when I run jsCode().test2(); I see 'Object does not support property or method "test2"'.
> 
> You added it too late to have any effect on the constructed object.
> Augmenting the prototype property of the constructor won't do anything
> until you construct another object.  On the contrary, you hacked the
> internal prototype of the constructed object for the other browsers.
> 
> What exactly are you trying to accomplish with this?

I try to extend my jsCode object by adding another objects to object jsCode. Exactly to jsCode prototype to use inheritance. I just want to create jsCode and implement method chaining. If I described it correctly.

> As a side note, it's hard to believe that JSFiddle still lacks My
> Library.  They were supposed to add it ages ago.  All of those old,
> dead Dojo, Prototype, etc. versions, yet no reference to the script
> they've been trying to catch up to for the last four years. :(

BTW as for MyLibrary I use the library in my private projects :-)
BTW When Your book will be released?

-- 
Regards,
CT

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Adding new method to existing object cezary.tomczyk@gmail.com - 2012-03-16 03:56 -0700
  Re: Adding new method to existing object David Mark <dmark.cinsoft@gmail.com> - 2012-03-16 04:50 -0700
    Re: Adding new method to existing object Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-03-16 15:31 +0100
      Re: Adding new method to existing object David Mark <dmark.cinsoft@gmail.com> - 2012-03-16 11:51 -0700
        Re: Adding new method to existing object Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-03-17 00:10 +0100
          Re: Adding new method to existing object David Mark <dmark.cinsoft@gmail.com> - 2012-03-16 17:25 -0700
            Re: Adding new method to existing object Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-03-17 02:04 +0100
              Re: Adding new method to existing object David Mark <dmark.cinsoft@gmail.com> - 2012-03-16 18:15 -0700
    Re: Adding new method to existing object cezary.tomczyk@gmail.com - 2012-03-16 10:18 -0700
      Re: Adding new method to existing object David Mark <dmark.cinsoft@gmail.com> - 2012-03-16 11:56 -0700
      Re: Adding new method to existing object David Mark <dmark.cinsoft@gmail.com> - 2012-03-16 13:01 -0700
        Re: Adding new method to existing object cezary.tomczyk@gmail.com - 2012-03-17 04:58 -0700
          Re: Adding new method to existing object David Mark <dmark.cinsoft@gmail.com> - 2012-03-17 16:04 -0700
            Re: Adding new method to existing object cezary.tomczyk@gmail.com - 2012-03-18 04:24 -0700
              Re: Adding new method to existing object John G Harris <john@nospam.demon.co.uk> - 2012-03-18 13:16 +0000
  Re: Adding new method to existing object John G Harris <john@nospam.demon.co.uk> - 2012-03-16 17:09 +0000
    Re: Adding new method to existing object cezary.tomczyk@gmail.com - 2012-03-16 10:46 -0700
  Re: Adding new method to existing object Scott Sauyet <scott.sauyet@gmail.com> - 2012-03-16 13:43 -0700
  Re: Adding new method to existing object Scott Sauyet <scott.sauyet@gmail.com> - 2012-03-16 20:15 -0700
    Re: Adding new method to existing object cezary.tomczyk@gmail.com - 2012-03-17 05:17 -0700
    Re: Adding new method to existing object cezary.tomczyk@gmail.com - 2012-03-17 05:24 -0700
      Re: Adding new method to existing object David Mark <dmark.cinsoft@gmail.com> - 2012-03-17 16:16 -0700
        Re: Adding new method to existing object cezary.tomczyk@gmail.com - 2012-03-18 04:27 -0700

csiph-web