Guten Tag,
ich weiß dass das Thema hier nicht so recht reinpasst, aber ich habe auch keine andere deutschsprachige Group gefunden, die sich mit HTML beschäftigt.
Ich habe eine Website für einen Radio-Sender u.a. mit Chat (und da das Java-Applett nicht neu geladen werden darf habe ich alles durch
css/javascript versteckt, d.h. beim klicken auf einen link wird nur das div-layer sichtbar gemacht).
Des weiteren ist dort eine kleine Box mit einem Iframe, dessen Seite sich alle 5 Sekunden aktualisiert (via JavaScript). So weit so gut - das tut es auch. aber bei jedem Aktualisieren verliert der Chat den Fokus - und das ist recht nervig, deshalb die Frage: Wie kann ich den Fokus wieder in den Chat setzen, bzw. es so machen das nicht das Iframe den Fokus bekommt?
Danke schonmal im Vorraus.
PS: Gibt es evtl. in Javascript eine Möglichkeit HTML-Dokumente vom Web in eine Variable/ein Array zu laden?
Anbei die Quellcodes:
teil einer include-datei (footer.php) in der index.php:
...
<div style="position: absolute; z-index: 0; bottom: 10px; right: 10px; border: 4px outset #FFFFFF" id="shoutcast">
<iframe name="I1" marginwidth="1" marginheight="1" height="75px" width="300px" scrolling="no" border="0" rameborder="0" src="include/shoutcast.php">
FRAME
</iframe>
</div>
...
shoutcast.php:
<?
include('query.php');
?>
<html>
<head>
<meta http-equiv="Content-Language" content="de">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>
Shoutcast Status
</title>
<style>
<!--
body {
font-family: Arial;
font-size: 10pt;
font-weight: bold
}
-->
</style>
<script>
function init() {
location.reload();
}
window.setTimeout("init()", 5000);
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<table border="0" width="300px" id="table1">
<tr>
<td width="50" align="right" valign="top">
<b>
<span style="font-size:10pt">
Titel:
</span>
</b>
</td>
<td>
<span style="font-size:10pt">
<? echo $streamdata["stream"]["song"] . "\n"; ?>
</span>
</td>
</tr>
<tr>
<td width="50" align="right">
<b>
<span style="font-size:10pt">
Zuhörer:
</span>
</b>
</td>
<td>
<span style="font-size:10pt">
<? echo $streamdata["stream"]["listener"] . "/" . $streamdata["stream"]["listener_max"] . "\n"; ?>
<a href="http://url/listen.m3u">
<b>PLAY</b>
</a>
</span>
</td>
</tr>
</table>
</body>
</html>