Function SearchField_OnKeyDown()
If window.event.keyCode = 8 Then
If window.event.repeat Or Not Em(document.all("SearchField").value) Then
lBackspaceExits = False
window.clearTimeOut(cBackTimeoutID)
cBackTimeoutID = window.setTimeout("ResetBackspaceExit()", 600)
ElseIf lBackspaceExits Then
window.history.back()
lBackspaceExits = False
End If
ElseIf window.event.keyCode = 13 Or _
window.event.keyCode = 38 Or window.event.keyCode = 40 Or _
window.event.keyCode = 33 Or window.event.keyCode = 34 Then
SearchField_OnKeyDown = document_onkeydown()
Exit Function
End If
SearchField_OnKeyDown = True
End Function
您能解释一下如何将上述函数转换为 javascript 吗?特别是我需要知道如何转换以下步骤
window.event.repeat
window.clearTimeOut(cBackTimeoutID)
window.setTimeout("ResetBackspaceExit()", 600)
SearchField_OnKeyDown = document_onkeydown()
event.repeat
不能在 javascript 中工作。返回undefined