Syntax difference in javascript function call?
3 answers
Explanation in words.
One element returns the value of the element whose attribute is located, the other will not.
return function (), click , function () , true.
, click onclick.
onclick="function ()" click , , .
, .
function some_func () { return false; }
<a href="http://google.com" onclick="return some_func()">
link #1
</a> <!-- user will never end up at google -->
javascript , .
<a href="http://google.com" onclick="some_func()">
link #1
</a> <!-- user will always end up at google -->
+2