Click to See Complete Forum and Search --> : Is there a keypress script that works outside my domain?
houseofstrauss
05-15-2003, 03:26 PM
I have a links page to websites outside of my domain. I want a keypress script that reveals my links page when it goes onBlur. I have tried a few scripts, but they do not work or are erratic. Can anyone help, or suggest another way of achieving this?
Thankyou, Rich
You mean onKeyPress= "location.href=somepagedependingonwhichkeywaspressed.html " ?
houseofstrauss
05-15-2003, 03:43 PM
This a snip ive used but it wont work. It sits in the page I want to call to focus. Its supposed to register a keypress x and bring the page into focus:
<script>
function handleKeyPress(evt) {
var nbr, chr;
if (window.Event) nbr = evt.which;
else nbr = event.keyCode;
//focuses window with x
else if(nbr==88){window.focus("http://www.etc/etc/remote2.htm");}
else{return true;}
}
document.onkeydown= handleKeyPress
</script>
Maybe my codes wrong, but you will see what Im after
window.focus(nameOfTheWindow);
houseofstrauss
05-15-2003, 04:10 PM
I've tried the onLoad="self.focus onBlur.focus" function. Its not the right control because it is always lost when clicking on the main page. (My link page is a small popup) I really feel this need to be controlled by the viewer, ie a hot key.