Heya Guys
Ive got a scrip that on a given key press uses location.href ='URL' this is great for the way we used to do things, now we made everything java so rather than going to a url i need it to run a javascript function, However after hours of trying i have no idea
i need it to do this
Code:
if (x==key1) location.href='<?echo "charmove($map_link_up,$hex_up)"; ?>';
the full script is below
Code:
<script language="javascript">
var key1="119";
var x='';
function handler(e)
{
if (document.all) {
var evnt = window.event;
x=evnt.keyCode;
}
else
x=e.charCode;
if (x==key1) location.href='<?echo "charmove($map_link_up,$hex_up)"; ?>';
}
if (!document.all){
window.captureEvents(Event.KEYPRESS);
window.onkeypress=handler;
}
else
{
document.onkeypress = handler;
}
</script>
Any help will be greatly welcomed
Thanks
Mike