Hi all,
class example not work in 1.5.1 API Doc
please fix it like that :
[---------------------------------------------------------------------------------------------------------------------------]
<html>
<head>
<title>Ajax Examples - class </title>
<script type="text/javascript"
src="prototype.js">
</script>
<script type="text/javascript">
var Animal = Class.create();
Animal.prototype = {
initialize: function (name,sound) {
this.name = name;
this.sound = sound;
},
speak: function() {
alert(this.name+" says: "+this.sound+" !");
}
};
function testClass()
{
var dog = new Animal("Dog","Bark");
dog.speak();
}
</script>
</head>
<body>
<button onclick="testClass()">testClass</button>
</body>
</html>
[---------------------------------------------------------------------------------------------------------------------------]
name and sound variable must be this.name and this.sound.
Regards,
Onur Yerlikaya
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---