|
|
Q1303 Why might you use "return functionName()" in an event handler as opposed to "functionName()"?
irt.org | Knowledge Base | JavaScript | Event | Q1303 [ previous next ] Q1303 Why might you use "return functionName()" in an event handler as opposed to "functionName()"?If the functionName() function updates the status message then the event handler has to return true for it to be effective (especially true for older browsers.) It returns the value that the functionName() function returns to the event that invokes the event handler. Basically you are saying, by returning true to the event, "yep, go ahead and do whatever", or by returning false to the event, "nope, cancel that". |
-- div -->
|