MozillaZine

js code bug under Firefox

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
alexlead
 
Posts: 1
Joined: October 18th, 2016, 5:39 am

Post Posted October 18th, 2016, 6:05 am

Hello All!

I have problem with JS game. When I block start button by code: document.getElementById('startButton').disabled = true; - firefox block keyboard inputs. (www.runwave.ru/snake/) The problem is under Firefox only (IE, Opera, Chrome work without problem). If I commented the code, keypad works under Firefox too. But there are some other problems.

If I block other button it is not help to solve the problem.

DanRaisch
Moderator

User avatar
 
Posts: 116389
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted October 18th, 2016, 6:12 am

Moving to Web Development.

Frenzie

User avatar
 
Posts: 2097
Joined: May 5th, 2004, 10:40 am
Location: Belgium

Post Posted October 22nd, 2016, 12:10 pm

First remove (blur) the focus.

Code: Select all
var startButton = document.getElementById('startButton');
startButton.blur();
startButton.setAttribute('disabled','disabled');
document.getElementById('newGameButton').setAttribute('disabled','disabled');
Intelligent alien life does exist, otherwise they would have contacted us.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 1 guest