perkeyone
something clever
- Reaction score
- 71
when i initially load this page it gives 2 alert messages. "0" and then "1"
on refresh it alerts "1" and then "2"...
why?
i am expecting it to be reset to 0 and 1 each time but it doesnt.
EDIT: this problem doesnt occur in ie but does in firefox
EDIT2: it seems to be a cache issue. i found that a "hard refresh" avoids the problem.
i am still looking for a way to fix this in my code though, since i didnt know how to hard refresh till about 3 min ago.
EDIT3: as a temporary fix, i am using javascript to manually set the input to 0 each time the page loads. id really like to find a true fix for this issue though.
on refresh it alerts "1" and then "2"...
why?
i am expecting it to be reset to 0 and 1 each time but it doesnt.
PHP:
<?php
echo "<input type=\"hidden\" value=0 id=\"selectcount\" name=\"selectcount\"/>";
echo "<script language=\"javascript\">alert(document.getElementById(\"selectcount\").value)</script>";
echo "<script language=\"javascript\">++document.getElementById(\"selectcount\").value</script>";
echo "<script language=\"javascript\">alert(document.getElementById(\"selectcount\").value)</script>";
?>
EDIT: this problem doesnt occur in ie but does in firefox
EDIT2: it seems to be a cache issue. i found that a "hard refresh" avoids the problem.
i am still looking for a way to fix this in my code though, since i didnt know how to hard refresh till about 3 min ago.
EDIT3: as a temporary fix, i am using javascript to manually set the input to 0 each time the page loads. id really like to find a true fix for this issue though.