js阻止表單預設提交併重新整理頁面
一、阻止重新整理頁面
在表單中的提交按鈕<button></button>標籤改為<input type="button">或者在<button>中新增屬性 type="button"
<button type="button" class="update_group"></button>
二、阻止表單的預設提交
1、使用preventDefault()
$("#uploadVideoForm").submit(function(e){ //uploadVideoForm為表單名稱 e.preventDefault() });
2、使用return false;
$("#uploadVideoForm").submit(function(e){//uploadVideoForm為表單名稱 return false; });