HI,
I am new programmer.
I looking to work with OOP in javascript.
I heard about prototypejs, and I try to run my first CODE in
firefox7.0.1
And Prototype JavaScript framework, version 1.7 .

The err that I got is "fred.loginfo is not function"


below the code:
************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <script type="text/javascript" src="/prototype_js/prototype.js"></
script>
  <title></title>
  </head>
  <body>
<script language="javascript" type="text/javascript">
function player(n,s,r){
    this.name=n;
    this.score=s;
    this.rank=r;
}

player.prototype.promte=function(){
    this.rank++;
    console.log("my new rank is: ",this.rank);
}

var fred=new player("fred,10000,5");
    fred.loginfo();
    fred.promote();

var bob=new player("bob,50,1");
    fred.loginfo();
    fred.promote();

var alise=new player("alise,233,33");
    fred.loginfo();
    fred.promote();

</script>
  </body>
</html>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to