Einfaches Javascript geht nicht
Oppa
- javascript
Moin,
ich habe hier ein Script gemacht und DAS GEHT NICHT!!
Weiß jemand warum??
<html>
<head>
<title></title>
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<script language="JavaScript">
var rows1=eval(Math.floor(screen.height/12.8));
var rows2=eval(Math.floor(screen.height/6.4));
var rows3=eval(Math.floor(screen.height/12.3));
var cols1=eval(Math.floor(screen.width/6));
var cols2=eval(Math.floor(screen.width/1.52));
var cols3=eval(Math.floor(screen.width/6.2));
document.daten.rows1.value=rows1;
document.daten.rows2.value=rows2;
document.daten.rows3.value=rows3;
document.daten.cols1.value=cols1;
document.daten.cols2.value=cols2;
document.daten.cols3.value=cols3;
</script>
</head>
<body>
<form action="/cgi-bin/frame2.pl" method="post" name="daten">
<input type="hidden" name="rows1" value="">
<input type="hidden" name="rows2" value="">
<input type="hidden" name="rows3" value="">
<input type="hidden" name="cols1" value="">
<input type="hidden" name="cols2" value="">
<input type="hidden" name="cols3" value="">
<input type="submit">
</form>
</body>
</html>
Da kommt dann ein Js-Fehler...
Hilfe, ich bin verzweifelt...
Hallo,
prinzipielle wäre die Angabe des verwendeten Browsers bzw. die Angabe der Fehlermeldung von Bedeutung.
rows und cols sind nicht im HTML-Dokument enthalten
<input id="eingabefeld1" name="eingabefeld1" type="text" value="">
IE4/NS4:
if(document.all||documnet.layers&&!document.getElementById){document.daten.eingabefeld1.value="etwas";}
else
{document.getElementById("eingabefeld1").value="etwas";}
eval ist hier übrigens auch nicht notwendig.
Viel Erfolg
Michael
Dankeschön,
Problem gelöst :-)
Grüße, Oppa