her er hele opg. - hjælp det virker stadig ikke - hvis jeg kan giver jeg 30 points til den der gider rette skidtet til...
<!-- saved from url=(0022)
http://internet.e-mail -->
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<SCRIPT language = JavaScript>
//Objektvariabler
function Bog(indeks, titel, forfatter, pris, billedref)
{
this.indeks = indeks;
this.titel = titel;
this.forfatter = forfatter;
this.pris = pris;
this.billedref = billedref;
}
function IndkoebsKurv(indhold2, saldo2)
{
this.indhold = new Array();
this.saldo = saldo2;
this.visIndhold = visIndhold;
this.tilfoej = tilfoej;
this.slet = slet;
}
function tilfoej(bog)
{
this.indhold[this.indhold.length] = bog;
this.saldo = this.saldo + bog.pris;
}
function visIndhold()
{
for (i=0; i<this.indhold.length; i++);
document.write(this.indhold[i].titel + \"<br>\");
}
function slet(index)
{
this.saldo = this.saldo - this.indhold[index].pris;
this.indhold[index] = null;
}
//metoder
function udskriv(bs)
{
for (i=0; i<4; i++);
document.write(bs[i].forfatter + \"<br>\");
}
// skabelse bøger og bogsamling
Bog0 = new Bog(1,\"Javascript Application Cookbook\",\"Jerry Bradenbaugh\",360,\"b1.gif\");
Bog1 = new Bog(2,\"Internet and WWW How to program \",\"Deitel & Deitel\",450,\"b2.gif\");
Bog2 = new Bog(3,\"DHTML For the World Wide Web\",\"Jason C. Teague\",250,\"b3.gif\");
Bog3 = new Bog(4,\"Building Web Applications with UML\",\"Jim Conallen\",300,\"b4.gif\");
bogSamling = [Bog0,Bog1,Bog2,Bog3];// varebeholdning = bogSamling
//skabelse af indkøbskurv
Kurv = new IndkoebsKurv();
//brugscenarie 1.3
//varebeholdning();
Kurv.tilfoej(bogSamling[0]);
Kurv.visIndhold();
//varebeholdning();
Kurv.tilfoej(bogSamling[1]);
Kurv.visIndhold();
Kurv.slet(1);
Kurv.visIndhold();
//bestillingsformular();
udskriv(bogSamling)
</script>
</body>
</html>