cat_evilness
11-23-2002, 12:12 AM
Okay. You guys have been so great today.
Now I have the code I need (see below) but there is a few more little things i need to figure out. I need it so that I can have the buttons that add 1 to the variable in one page and then the actual variables in another page. Does anyone know what the code is to do this.
Here is the code I need to seperate into 2 different pages: Something like this?
<html>
<head>
<script language="javascript">
<!--
var countdownValue='10';
function countdownScript(){
if(countdownValue>=10){
countdownValue=10
}
countdown.innerHTML=countdownValue;
if(countdownValue<=0){
clearTimeout(Timer)
}
else{
countdownValue--;
Timer=setTimeout("countdownScript();", 3000);
}
}
function hmm(){
clearTimeout(Timer)
countdownValue+=2
countdownScript()
}
onload=countdownScript
//-->
</script>
<title>Virtual Pet - Version 1.0</title>
</head>
<body bgcolor="#FF9900" text="#ffff99" link="#00ff00" alink="#ffa500" vlink="#ff0000">
<basefont size="3">
<table width="220" valign="top" border="0">
<tr>
<td width="180" bgcolor="#000000" valign="left" align="left" border="0">
Mood:</br>
</td>
<td width="40" bgcolor="#000000" valign="left" align="left" border="0">
<span id="countdown"></span></br>
</td>
</tr>
</table>
<form name=f1>
<input type="button" value="Button" onclick="hmm()">
</form>
</body>
</html>
Thankyou all so much
Cat ;)
Now I have the code I need (see below) but there is a few more little things i need to figure out. I need it so that I can have the buttons that add 1 to the variable in one page and then the actual variables in another page. Does anyone know what the code is to do this.
Here is the code I need to seperate into 2 different pages: Something like this?
<html>
<head>
<script language="javascript">
<!--
var countdownValue='10';
function countdownScript(){
if(countdownValue>=10){
countdownValue=10
}
countdown.innerHTML=countdownValue;
if(countdownValue<=0){
clearTimeout(Timer)
}
else{
countdownValue--;
Timer=setTimeout("countdownScript();", 3000);
}
}
function hmm(){
clearTimeout(Timer)
countdownValue+=2
countdownScript()
}
onload=countdownScript
//-->
</script>
<title>Virtual Pet - Version 1.0</title>
</head>
<body bgcolor="#FF9900" text="#ffff99" link="#00ff00" alink="#ffa500" vlink="#ff0000">
<basefont size="3">
<table width="220" valign="top" border="0">
<tr>
<td width="180" bgcolor="#000000" valign="left" align="left" border="0">
Mood:</br>
</td>
<td width="40" bgcolor="#000000" valign="left" align="left" border="0">
<span id="countdown"></span></br>
</td>
</tr>
</table>
<form name=f1>
<input type="button" value="Button" onclick="hmm()">
</form>
</body>
</html>
Thankyou all so much
Cat ;)