JSFiddle - React, Tailwind, and code Playground
by reporter
HTML
<html>
<head>
<title></title>
</head>
<body>
<form name="form1" action="#">
<b>Webcam-Adresse:</b><br>
<input type="text" name="camurl" style="width:250px"><br><br>
<b>Webcam-Name:</b><br>
<input type="text" name="camname" style="width:250px">
<b><h5>Pflichtfelder!</h5></b>
<b><h6>**************************************************</h6></b>
<b>Zur Auswahlliste hinzufügen ?</b>
<input type="button" value="Ja" style="width:47px" onclick="chkFormular();"><br><br>
<select name="select" style="width:250px" onchange="this.form.camurl.value=this.options[this.selectedIndex].value; this.form.camname.value=this.options[this.selectedIndex].text;">;
<option value="">Auswahlliste</option>
<option value="http://www.thueringer-webcams.de/kunden/mdr/weimar/livebild-pal.jpg">Weimar, Theaterplatz</option>
</select>
<b><h6>**************************************************</h6></b>
<b>Aktualisierung in Sekunden:</b>
<br>
<input type="text" id="interval" value="">
</form>
<img src="habus.png" alt="" width="25" height="44"><font color="windowtext" size="1" face="Arial">Webcam 1.0 © 2012 by Habus</font>
</body>
</html>
JavaScript
<script type="text/javascript">
function meineWebkamera(kameraAdresse, kamaraName)
{
this.url = kameraAdresse;
this.name = kamaraName;
}
filename = "camurls.txt";
fso = fso = new ActiveXObject("Scripting.Filesystemobject");
kammeraSammlung = new Array();
function init()
{
selectList = document.getElementsByName("select")[0];
var file = fso.OpenTextFile( filename, 1 );
while (!file.AtEndOfStream)
{
var splitArray = f.ReadLine().split("|");
var kamaraData = new meineWebkamera (splitArray[0],splitArray[1]);
kammeraSammlung.push(kamaraData);
}
file.close();
for (index = 0; index < kammeraSammlung.length; index++)
{
arrayElement = kammeraSammlung[indesx];
neuerEintrag = new Option(arrayLElement.url, arrayElement.name, false, false);
selectList.options[selectList.options.length] = neuerEintrag;
}
}
function chkFormular()
{
var eingabe1 = document.form1.camurl.value;
var eingabe2 = document.form1.camname.value;
//??? Keine Ahnung was du her mit dem Fileobjekt tun möchtest.
}
window.onload = init;
</script>