BDT
04-25-2003, 04:20 PM
I want to use JS for a page with several images each with several small text links superimposed on it. Both the images and the text in the links will change dynamically with screen interactions. I think that I need to 'paint' the screem with a function so that I can rerun the function when the various text and images change.
Anyway, I tried without success to get this to work, but keep getting an error at line 1 / character 1.
Here is a simple script that shows the problem. I suspect that I'm missing something obvious and hope that someone can explain why this approach isn't working.
thanks, BDT
<html>
<head>
<title>Hex Game</title>
<script language="javascript" type="text/javascript">
var h = 23;
function drawscreen() {
document.write(h + "<hr>");
document.write('<form1><input type="button" value="click" onClick="update()"></form1>');
}
function update() {
h=h+1;
// alert("h= " + h);
drawscreen();
}
</script>
</head>
<body onLoad="drawscreen();">
</body>
</html>
Anyway, I tried without success to get this to work, but keep getting an error at line 1 / character 1.
Here is a simple script that shows the problem. I suspect that I'm missing something obvious and hope that someone can explain why this approach isn't working.
thanks, BDT
<html>
<head>
<title>Hex Game</title>
<script language="javascript" type="text/javascript">
var h = 23;
function drawscreen() {
document.write(h + "<hr>");
document.write('<form1><input type="button" value="click" onClick="update()"></form1>');
}
function update() {
h=h+1;
// alert("h= " + h);
drawscreen();
}
</script>
</head>
<body onLoad="drawscreen();">
</body>
</html>