bootstrap modal href方式清除缓存
$('#contactAddModal').on('loaded.bs.modal', function () { $("#contactAddForm").validate({ ignore: "", submitHandler: function(form){ //表单提交句柄,为一回调函数,带一个参数:form $.ajax({ type: "POST", url: "/contacts/save2.do?orgId="+id, data: $("#contactAddForm").serializeArray(), dataType: 'json', success: function(result){ if (result.status == 1) { swal("提示", "新增成功", "success"); reflushPage(); } else { if (result.info == "") { toastr.success("数据异常!"); } else { toastr.error(result.info); } } } }); } }); }); $('#contactAddModal').on('hidden.bs.modal', function () { $(this).removeData("bs.modal"); $("#contactAddForm").empty(); $("#contactAddForm").html("数据正在加载..."); });