I'm a complete noob to Prototype and don't know how to call a method
from another method.

I'm using the [URL="http://www.prototypejs.org/learn/class-
inheritance"]Prototype JS library[/URL] to make classes.

++++++++++++++++++++++++
var myClass = Class.create({
   initialize: function() {
      this.myValue = 5;
   },
   returnHello: function() {
      return 'hello';
   },
   explainYourself: function() {
      return this.returnHello() + ", my value is: " + this.myValue;
   }
});
++++++++++++++++++++++++++

In explainYourself(), I tried to call returnHello() and I got an error
saying this.returnHello() is not a function. What is the correct
syntax?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to