JavaScript methods: method, uber and inherits?

Discussion in 'Javascript' started by relaxedrob@optushome.com.au, Sep 2, 2003.

  1. Guest

    Howdy All!

    I was reading this page:
    http://www.crockford.com/javascript/inheritance.html

    And it has some code examples:

    function Parenizor(value) {
    this.setValue(value);
    }
    Parenizor.method('setValue', function (value) {
    this.value = value;
    return this;
    });
    Parenizor.method('getValue', function () {
    return this.value;
    });
    Parenizor.method('toString', function () {
    return '(' + this.getValue() + ')';
    });


    Is this code ok? I am getting errors saying:
    Error: Parenizor.method is not a function

    And then there are some other examples:

    function ZParenizor(value) {
    this.setValue(value);
    }
    ZParenizor.inherits(Parenizor);
    ZParenizor.method('toString', function () {
    if (this.getValue()) {
    return this.uber('toString');
    }
    return "-0-";
    });


    I have been checking the ECMAScript spec's .. and there are no
    mentions of methods called 'uber' or 'inherits' ...

    What am I missing here?

    Thanks for any advice!

    Rob
    :)
    , Sep 2, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Nitulescu
    Replies:
    0
    Views:
    341
    Alex Nitulescu
    Feb 22, 2005
  2. Heiner Kücker
    Replies:
    1
    Views:
    551
    Joona I Palaste
    Dec 4, 2004
  3. Jörg Heinrich

    Variablenübergabe über Link

    Jörg Heinrich, Jul 21, 2004, in forum: HTML
    Replies:
    2
    Views:
    425
    Sam Hughes
    Jul 21, 2004
  4. ton
    Replies:
    1
    Views:
    1,002
    Teemu Keiski
    Jun 24, 2007
  5. Replies:
    0
    Views:
    249
Loading...

Share This Page