Sorry would have posted sooner except the I couldnt reply without this error message;
1. Board will be closed for next 5 minutes for some routine maintenance.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
//<![CDATA[
function changestate()
{
document.getElementById('state').innerHTML = "working";
for(n=0;n<=10000000;n++){
if(n==10000000) alert("Done");
}
document.getElementById('state').innerHTML = "ready";
}
//]]>
</script>
</head>
<body>
<div id="state" onclick="changestate()">Started</div>
</body>
</html>
I coded this and reproduced the problem. Now, it seems that the function does something that Ive never encountered before in that the changes seem to bunch up and complete when all other things have completed. Ill mess about with this some more and get back hopefully but if anyone else knows why javascript does this or maybe suggest I get some sleep if I missed something stupid 
Kind regards
Dal
Bookmarks