Thursday, May 1, 2014

Disable Refresh

anda tidak akan bisa mereload halaman ini dengan menggukan refresh atau f5.
berikut kodenya


<html >
<head >
    <title>Disable Refresh</title>

    <script type="text/javascript">

        var version = navigator.appVersion;

        function showKeyCode(e) {
            var keycode = (window.event) ? event.keyCode : e.keyCode;

            if ((version.indexOf('MSIE') != -1)) {
                if (keycode == 116) {
                    event.keyCode = 0;
                    event.returnValue = false;
                    return false;
                }
            }
            else {
                if (keycode == 116) {
                    return false;
                }
            }
        }

    </script>

</head>
<body onload="JavaScript:document.body.focus();" onkeydown="return showKeyCode(event)">
Kaga bisa direfresh jon coba aja haha
</body>
</html>

No comments:

Post a Comment