Tobias T.: 2 bzw 3 frames und 1 davon soll sich selbst ersetzen

Hallo

Ich hab eine Frameset mit 3 Frames. Davon soll einer oder zwei geändert werden (was ja nicht schwer ist :) ) aber das frame wo der Link dazu drin ist soll sich selbst ersetzen durch eine andere Seite, und das bekomm ich absolut nicht hin.
Hab in der Doku und im archiv leider auch nichts darüber gefunden oder ich war blind.

thx4help
majoto

  1. Hallo.

    Ich hab eine Frameset mit 3 Frames. Davon soll einer oder zwei geändert werden (was ja nicht schwer ist :) ) aber das frame wo der Link dazu drin ist soll sich selbst ersetzen durch eine andere Seite, und das bekomm ich absolut nicht hin.
    Hab in der Doku und im archiv leider auch nichts darüber gefunden oder ich war blind.

    <html>
    <head>
    <title>Frameset-Overkill</title>
    </head>
    <script type="text/javascript">
    <!--
     frame_count = parseInt(window.prompt("Wie viele Frames möchtest du gleichzeitig ändern?","2"));
     while(frame_count == null || frame_count == "" || frame_count < 2 || isNaN(frame_count) == true)
      {
       window.alert("Du möchtest mindestens zwei Frames gleichzeitig ändern!");
       frame_count = parseInt(window.prompt("Wie viele Frames möchtest du gleichzeitig ändern?","2"));
      }
     document.open("text/html");
     document.write("<frameset rows="");
     for(i = 0; i < Math.floor(Math.sqrt(frame_count)); i++)
      {
       if(i == 0 || i == Math.floor(Math.sqrt(frame_count))-1)
        {
         if(i == 0){document.write("*")}
         else{if(i == Math.floor(Math.sqrt(frame_count))-1){document.write(",*")}}
        }
       else{document.write(",*")}
      }
     document.write("" onload="write_content()">");
     for(x = 1; x <= Math.floor(Math.sqrt(frame_count)); x++)
      {
       document.writeln(" <frameset cols="");
       if(x == 1){colums = Math.ceil(frame_count/Math.floor(Math.sqrt(frame_count)))-((Math.floor(Math.sqrt(frame_count))*Math.ceil(frame_count/Math.floor(Math.sqrt(frame_count))))-frame_count)}
       else{colums = Math.ceil(frame_count/Math.floor(Math.sqrt(frame_count)))}
       for(i = 0; i < colums; i++)
        {
         if(i == 0 || i == colums-1)
          {
           if(i == 0){document.write("*")}
           else{if(i == colums-1){document.write(",*")}}
          }
         else{document.write(",*")}
        }
       document.writeln("" onload="write_content()">");
       for(y = 1; y <= colums; y++){document.writeln("  <frame src="about:blank" marginwidth="4" marginheight="4">")}
       document.writeln(" </frameset>");
      }
     document.writeln("</frameset>");
     document.close();
     function write_content()
      {
       for(n = 0; n < frame_count; n++)
        {
         window.frames[n].document.open("text/html");
         window.frames[n].document.writeln("<html>");
         window.frames[n].document.writeln("<head>");
         window.frames[n].document.writeln("<title>" + eval(n+1) + ". Frame des Framesets</title>");
         window.frames[n].document.writeln("</head>");
         window.frames[n].document.writeln("<body>");
         window.frames[n].document.writeln("<table width="100%" height="100%" style="width:100%; height:100%;" cellspacing="0" cellpadding="0" border="0">");
         window.frames[n].document.writeln(" <tr>");
         window.frames[n].document.writeln("  <td align="center" valign="middle"><a href="javascript:parent.change_them_all(0)">" + frame_count + " Frames<br>gleichzeitig<br>ändern</a></td>");
         window.frames[n].document.writeln(" </tr>");
         window.frames[n].document.writeln("</table>");
         window.frames[n].document.writeln("</body>");
         window.frames[n].document.write("</html>");
         window.frames[n].document.close();
        }
      }
     frame_location = new Array();
     frame_location[frame_location.length] = "http://selfhtml.teamone.de/html/frames/index.htm";
     frame_location[frame_location.length] = "http://selfhtml.teamone.de/html/frames/eigenschaften.htm";
     frame_location[frame_location.length] = "http://selfhtml.teamone.de/html/frames/verweise.htm";
     frame_location[frame_location.length] = "http://selfhtml.teamone.de/javascript/objekte/frames.htm#allgemeines";
     frame_location[frame_location.length] = "http://selfhtml.teamone.de/javascript/beispiele/zweiframes.htm";
     frame_location[frame_location.length] = "http://selfhtml.teamone.de/javascript/beispiele/zweiframes.htm#hinweise";
     frame_location[frame_location.length] = "http://selfhtml.teamone.de/javascript/beispiele/zweiframes.htm#quelltext";
     frame_location[frame_location.length] = "http://selfhtml.teamone.de/navigation/faq.htm#zwei_frames";
     frame_location[frame_location.length] = "http://forum.de.selfhtml.org/faq/#Q-32i";
     function change_them_all(n)
      {
       window.frames[n].location.href = frame_location[Math.round(Math.random()*(frame_location.length-1))]; n++;
       if(n < frame_count){window.setTimeout("change_them_all(" + n + ")",10)}
      }
    //-->
    </script>
    <body>
    Dein Browser kann leider nicht zwei Frames gleichzeitig ändern.
    </body>
    </html>

    SCNR

    Gruß
    Norbert

    1. thx für die flotte hilfe :)

      Tobias