Just wondering what the ‘event’ keyword means in this instance? Is it a keyword and passing the actual event that will contain the keycode?
<asp:TextBox ID="tbSearch" runat="server" onkeyup="return dontSubmit(event);">
<script type="text/javascript">
function dontSubmit(event) {
console.log('dont submit');
console.log(event.keyCode);
}
</script>
The event object is passed by the browser to event handlers when an event occurs in order so you can query different information about the event ( such as x/y position, key clicked, etc ).
Note: It can be named anything, so if you change
function(event)tofunction(lol)and reference it withlolit would work the same way.See https://developer.mozilla.org/en/DOM/Event for more info.