Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 10:57 AM
relaxedrob@optushome.com.au
Guest
 
Posts: n/a
Default JavaScript methods: method, uber and inherits?

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
:)
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles