In the way of doing things, suddenly found JS inside can return,return false, completely do not know what meaning to find the data to tidy up
You can return FALSE if you want to cancel the object's default action.
First in JS, we often use return false to prevent the submission of the form or the person continues to execute the following code, in general, to prevent the execution of the default behavior.
function A () {
if (True)
return false;
}, there is no problem with this.
If I change into this
function Test () {
A ();
b ();
C ();
}
Even if the a function returns false to prevent the commit, it does not affect the execution of the B () and C () functions. Call the A () function in the test () function.
Return false is equivalent to the return value for the test () function. The test () function cannot be prevented from executing.
In summary: Return false is valid only in the current function and does not affect the execution of other external functions.
Three: summary
Retrun true; Returns the correct processing result.
return false; Branch error processing result, terminate processing.
return; Returns control to the page.
JS in return, return true, return false;