-
Question: Can you make Javascript respond to keys, for instance if I pressed 'w' could it execute an if statement? Also, how long have you been interested in programming?
- Keywords:
Asked by DrProfessorKit to Andy on 17 Dec 2014.Question: Can you make Javascript respond to keys, for instance if I pressed 'w' could it execute an if statement? Also, how long have you been interested in programming?
- Keywords:
Comments
DrProfessorKit commented on :
Thanks! Also, what program can I use to test out Javascript programs? Like you can download a free program to program in Python is there an equivalent for Javascript?
Andy commented on :
You can use your own web browser actually, (I’m assuming that you’re using Microsoft Windows) i.e. enter in the URL bar
file:///c:/my_project_directory/my_test.html
(obviously replacing my_project_directory/my_test.html with the actual path and filename of your html file)
… and just hit F5 to refresh the page each time you change anything in your code!
DrProfessorKit commented on :
So, I make a file, enter the path to it into my url and then do it?
Andy commented on :
Yeah that’s it. You can edit your HTML file with a plain text editor such as notepad, save the file, and hit F5 on the browser to see the changes.
(I’d use ‘notepad++’ instead, so if you’re OK with downloading and installing on your computer, it is available from here: http://notepad-plus-plus.org/download/v6.7.html )
DrProfessorKit commented on :
Thanks! 😀 Now I can test something out, I know it’s simple but I want to make a binary code translator, first in Python, then in JavaScript. I have programmed it in Python, but for some reason it always misses out a letter.