Kai: Javascriptchaos ?

Beitrag lesen

Hallo Stefan,

Also das Beispiel war mir jetzt zu umfangreich, um es bis in alle Einzelheiten zu analysieren. Aber: die Angabe <base target...> in der Datei mit Frame-Set-Definitionen erscheint mir ziemlich unsinnig, ebenso das target-Attribut in einer <frame>-Definition. Versuche besser, in der JavaScript-Funktion GoSponsor() vor den location.href's das Zielfenster korrekt zu adressieren. Probier mal parent.frames[1].location.href...

Das habe ich ja versucht, es will aber nicht , weil es ja ein Frameset innnerhalb eines anderen FS anspricht:

//C)links.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//DE,EN">
<html>

<head>
<script LANGUAGE="JavaScript">

var sponsor = 1;

function GoSponsor() {
   if (sponsor==1) parent.mitte2.location.href="html/1.html";
   if (sponsor==2) parent.mitte2.location.href="html/2.html";
   if (sponsor==3) parent.mitte2.location.href="html/3.html";
   if (sponsor==4) parent.mitte2.location.href="html/4.html";
}

// function to rotate image (currently uses 4 images)
function rotate() {
   if (++sponsor > 4)  sponsor = 1;
   document.images[0].src = "w" + sponsor + ".gif";
   window.setTimeout('rotate();',5000);
}

</script>

<title>links</title>
</head>

<body onLoad="window.setTimeout('rotate();',5000);">
<div align="left">
<table border="0" cellpadding="5" cellspacing="10" width="110">
  <tr>
    <td bgcolor="#FF6633" height="110"><a HREF="javascript:GoSponsor();"><p align="center"><img
    NAME="w" SRC="w1.gif" width="100" height="100" border="0"></td>
  </tr>
  </table>
</div>
</body>
</html>