此功能在 Internet Explorer 和 Firefox 中不起作用。在 Firefox 中,它返回以下错误:
TypeError: e is undefined
[Break On This Error]
...e.which == "number") ?e.which : e.keyCode; keyCodeEntered = (e.which) ? e.哪个...
功能:
function onSearchPhraseKeyDown(e) {
var buttonId = '<%=SearchButton.ClientID %>';
if (!e)
var e = (typeof e.which == "number") ? e.which : e.keyCode;
keyCodeEntered = (e.which) ? e.which : window.event.keyCode;
if ((keyCodeEntered == 13) || (keyCodeEntered == 13)) {
document.getElementById(buttonId).click();
return false;
} else {
return true;
}
}
任何人都可以看到有什么问题吗?