表單 action, 鏈接href,js 綁定按鈕 ajax綁定標簽
<h1>通過表單提交參數</h1> <form action="/day46_v1/ServletDemo01?method=addUser" method="post"> 用戶名:<input type="text" name="username"/><button>提交</button> </form> <h1>通過鏈接提交參數</h1> <a href="/day46_v1/ServletDemo01?method=delUser&uid=003">刪除</a> <h1>通過Ajax提交參數</h1> <input type="text" name="username"/><button onclick="fn()">發送請求</button> <h1>通過JS發送請求</h1> <button onclick="fm()">點擊我向服務端發起請求</button>