Spectre Posted January 9, 2012 Share Posted January 9, 2012 Hey guys and gals, I've got some code on a game I code for, nice and simple, it's just something as extra control of a navigation system. Simple thing, checks for a certain keypress, each key in the list will output a line into the URL to navigate. ?> <script language="javascript"> function getArrows(event) { arrows=((event.which)||(event.keyCode)); switch(arrows) { case 37: action = 'left'; break; case 38: action = 'up'; break; case 39: action = 'right'; break; case 40: action = 'down'; break; case 100: action = 'left'; break; case 104: action = 'up'; break; case 102: action = 'right'; break; case 98: action = 'down'; break; case 97: action = 'downleft'; break; case 99: action = 'downright'; break; case 103: action = 'upleft'; break; case 105: action = 'upright'; break; } window.location.href = "/quest.php?action="+action; } </script> <body onkeydown="getArrows(event)"> <? Now that's been working fine since I put it in like 2 years back? But suddenly it seems to not like to work in FF, a few users have reported this, mine was fine a few days back, but suddenly now is also spazzing, I believe since FF updated (i've had it open for weeks so it's not had chance until the other day to update to latest version). Any advice would be greatly appreciated, the navigation takes place on an grid from 0-80 on both axis, and the use of keyboard is much easier than clicking with mouse etc, so would really like to fix things >_< Quote Link to comment https://forums.phpfreaks.com/topic/254638-code-which-stopped-working-in-ff/ Share on other sites More sharing options...
Muddy_Funster Posted January 9, 2012 Share Posted January 9, 2012 as your already using FF, and since this looks like a JS/AJAX problem rather than a PHP one, you would be much better off getting and installing the FireBug plugin for FF and using that to realtime debug your JS code in firefox its self. Quote Link to comment https://forums.phpfreaks.com/topic/254638-code-which-stopped-working-in-ff/#findComment-1305702 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.