关于为什么有些<a>和<input>标签中的onclick方法会有return,如<a class = '' onclick = "upload();return;" ></a>
今天刚好看到代码中有上传事件;其中有个点击附加上传的方法,但是这个upload()方法后面还有个return,我查了下,有些写的是return false;意思是这个onclick方法中已经有提交了,如果不写return 就会有两次提交,因为在最后的form标签还会提交一次。
关于为什么有些<a>和<input>标签中的onclick方法会有return,如<a class = '' onclick = "upload();return;" ></a>
今天刚好看到代码中有上传事件;其中有个点击附加上传的方法,但是这个upload()方法后面还有个return,我查了下,有些写的是return false;意思是这个onclick方法中已经有提交了,如果不写return 就会有两次提交,因为在最后的form标签还会提交一次。