$("#GetLog").submit(function (e) {
e.preventDefault();
$.ajax({
//some code
});
});
<form id="GetLog">
<input type="submit">
</form>
我想在頁面加載時以及用戶按下提交按鈕時調用此函數。在頁面加載和表單提交時調用相同的函數
我曾嘗試在頁面加載document.getElementById("GetLog").submit()
但它調用的函數。
你真的應該使這個問題更容易閱讀。 – Hego555
我認爲這很好。你的具體抱怨是什麼?這不是文獻,但它是可讀的。 –