vendredi 29 juillet 2016

Send command to other webpage while key pressed, and another while unpressed

I'm assuming Javascript is likely the best method of going about the problem, but how could I accomplish the following;

While the Up key is pressed, run/load a PHP script four times a second (same directory & server, say forward.php) that performs a function - the PHP script doesn't output anything on the webpage so I'd like it to kind of load in the background.

And while the Up key is not pressed, load another webpage (say off.php) with the same frequency (and not poll forward.php).




Aucun commentaire:

Enregistrer un commentaire