Forum » Programiranje » javascript problem
javascript problem
kretze ::
zdravo folk kaj ve kdo kaj morem spremenit v 61 vrstici da bo delalo??
<html> <head> <title>footballClub</title> </head> <body> <h2> summary of club </h2> <script type="text/javascript"> function player(name,surname,numOfGoals,jerseyNumber) { this.name=name; this.surname=surname; this.numOfGoals=numOfGoals; this.jerseyNumber=jerseyNumber; } player.prototype.getNmae=function() { return this.name; } player.prototype.setNmae=function(n) { this.name=n; } player.prototype.getSurname=function() { return this.surname; } player.prototype.setSurname=function(s) { this.surname=s; } player.prototype.getGoals=function() { return this.numOfGoals; } player.prototype.setGoal=function(g) { this.numOfGoals=g; } player.prototype.getjersey=function() { return this.jerseyNumber; } player.prototype.setjersey=function(j) { jerseyNumber=j; } function club() { this.klub=new Array(); } club.prototype.addname=function(name,surname,numOfGoals,jerseyNumber) { this.club[name]=new player(name,surname,numOfGoals,jerseyNumber); } club.prototype.getPlayerTable=function() { var playerss; var playerTableHTML="<table border=1>"; for(playerss in this.klub) { playerTableHTML+="<tr><td>"; playerTableHTML+=club[playerss].getNmae(); playerTableHTML+="</td>"; playerTableHTML+="<td>"; playerTableHTML+=club[playerss].getSurname(); playerTableHTML+="</td>"; playerTableHTML += "<td>"; playerTableHTML+=club[playerss].getGoals(); playerTableHTML += "</td>"; playerTableHTML += "<td>"; playerTableHTML+=club[playerss].getjersey(); playerTableHTML += "</td>"; } playerTableHTML+="</table>"; return playerTableHTML; } var player1=new club(); player1.addname("lionell","messi",49,10); player1.addname("andres","iniesta",5,8); document.write(player1.getPlayerTable()); </script> </body> </html>
amacar ::
this.klub[name]=new player(name,surname,numOfGoals,jerseyNumber);
Zgodovina sprememb…
- spremenil: amacar ()
amacar ::
Pa popraviti moraš še 71., 76., 79., 82. vrstico
Pa piši normalno, ne pa s toliko napakami (getNmae (vrstni red), getjersey (vse z malo)).
Pa v funkciji getPlayerTable nimaš
this.klub[playerss].getNmae(); //itd za vse 4 vrstice
Pa piši normalno, ne pa s toliko napakami (getNmae (vrstni red), getjersey (vse z malo)).
Pa v funkciji getPlayerTable nimaš
</tr>
Zgodovina sprememb…
- spremenil: amacar ()
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | [JavaScript] ObjectsOddelek: Programiranje | 2760 (2222) | noraguta |
» | Kontakt obrazecOddelek: Izdelava spletišč | 2061 (1906) | betmen |
» | mdb prevelikOddelek: Programiranje | 724 (546) | darkkk |
» | Javascript - izračun razlike v datumihOddelek: Programiranje | 1912 (1767) | kogledom |
» | [Flash] predvajanje videaOddelek: Programiranje | 1757 (1605) | R33D3M33R |