【发布时间】:2017-06-24 11:36:21
【问题描述】:
我如何创建一个功能,例如当我按下键盘上的“A”键时,它会按下 On 并发出 nupp('/TS') 的信号。同样在“A”键释放上,它应该最先发送 nupp('/TS') 的信号。
<html>
<head>
<script src=\"https://code.jquery.com/jquery-2.2.4.min.js\"></script>
<script> client.println("function nupp(url){ $.ajax(url); }"</script>
<button type=\"button\" onclick=\"nupp('/TS');\">On</button>
</head>
<body>
【问题讨论】:
-
试试
onkeyup和onkeydown
标签: javascript ajax button keyboard keydown