Tjoh ...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd"><html>
<head>
<title>Brug roenvingDate simpelt</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html,body{height:100%;margin:0px;border:0px;padding:0px;font-family:tahoma,verdana,arial,sans-serif;font-size:small;}
</style>
<script language="javascript" type="text/javascript">
var ids = [], times = [], endDate = [];
function opdater(){
for(var i=0,im=ids.length;im>i;i++){
document.getElementById(ids[i]).firstChild.nodeValue = endDate[i].age(0,0,6,1);
}
}
window.onload = function(){
var nu = new Date();
for(var i=0,im=ids.length;im>i;i++){
endDate[i] = new Date(nu.getTime() + times[i] * 1000);
document.getElementById(ids[i]).firstChild.nodeValue = endDate[i].age(0,0,6,1);
alert(i);
}
setInterval("opdater()",1000);
}
</script>
<script type="text/javascript" src="roenvingDate.js"></script>
<!--script type="text/javascript" src="../Udvikling/roenvingDate_en.js"></script-->
</head>
<body>
<?php
$i = 0;
while($row = mysql_fetch_assoc($ingredienserquery)) {
$howmuch = $row['produced'];
$remainingtime = $row['hastighed']-($tidnu-$row['sidsteupdate']);
echo "<p>Ingrediens: $row['ingrediens'], nu fremstillet: $howmuch.<br>";
echo "<script type='text/javascript'>ids[ids.length]='iSpan'+$i; times[times.length]=$remainingtime;</script>";
echo "Tid tilbage: <span id='iSpan'+$i> </span></p>";
$i++;
}
?>
<p>Ingrediens: Min1ingrediens, nu fremstillet: 13.<br>
<script type='text/javascript'>ids[ids.length]='iSpan0'; times[times.length]=261230;</script>
Tid tilbage: <span id='iSpan0'> </span></p>
<p>Ingrediens: Min2ingrediens, nu fremstillet: 73.<br>
<script type='text/javascript'>ids[ids.length]='iSpan1'; times[times.length]=6123023;</script>
Tid tilbage: <span id='iSpan1'> </span></p>
</body>
</html>
-- som du kan se har jeg sat nogle fiktive eksempler ind, da jeg jo ikke har din php/mySql-ting !-)