<script type="text/javascript">
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Roy Marchand | http://www.expertsrt.com */
var key1="32";
var x='';
function handler(e) {
if (document.all) {
var evnt = window.event;
x=evnt.keyCode;
} else
x=e.charCode;
if (x==key1) alert("That's how it works! Cool, huh?");
// You could do something like redirect the user to another page:
// if (x==key1) location.href='http://www.expertsrt.com';
}
if (!document.all) {
window.captureEvents(Event.KEYPRESS);
window.onkeypress=handler;
} else {
document.onkeypress = handler;
}
</script>


Alıntı ile Cevapla

Paylaş