Morgen.
Ich hatte auch die Idee ein sinnloses kleines Script zu schreiben, um 1000 Frames gleichzeitig zu ändern. Naja, wie's aussieht, hab ich ein bissel länger gebraucht, als du, aber dafür funktioniert's jetzt auch in allen gängigen Browsern. Es passt zwar nicht zum ersten April, hat auch sonst keinen tieferen Sinn, aber wat solled?
Das höchste, was mein IE6 geschaft hat, waren 3000 Frames (nich per second), wobei er ungefähr 'ne Viertelstunde gebraucht hat (ich sach ja, nich per second). Aber ich würd' ma sagen, ab 1000 wird's schon ein bissel gefährlich für den Browser, naja, vielleicht eher ab 500, also 100 is ein guter Wert zum Ausprobiern. Aber wenn man einen Groll gegen seinen Browser hegt, is das Script ganz gut geeignet um ihn umzubringen, man braucht nur ne große Zahl und ein bißchen Zeit. Ansonsten, stellt sich vielleicht noch ein geringer Lerneffekt beim User ein, welcher auf den verlinkten Seiten beruhen dürfte, welche man jedoch bei zu hoher Frame-Anzahl nicht sehen kann, weil'se zu klein werden, die Seiten.
Naja, Script is das hier:
-------------------------
<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>
Robert (der sich fragt, ob das hier überhaupt noch irgend einen Sinn hat)
Gruß
Norbert (der weiß, dass es sinnlos ist, aber trotzdem weiter macht)