Menu
[code=php]
<script type=”text/javascript”>
document.onkeyup = KeyCheck;
function KeyCheck(e)
{
var KeyID = (window.event) ? event.keyCode : e.keyCode;
if (KeyID == 27) //ESC
//close browser window
else
window.location = “<?php echo $_SERVER[‘SCRIPT_NAME’];?>/”+”<?php echo rand(100,999);?>”;
}
</script>
<?php
echo ‘<div align=”center”>Press any key</div>’;
?>
This code will generate a random url, now I want if user press Esc or some times ( I set ) it will close the browser window, and I want to set a time delay between each times key pressed. Thank for helping.