1 回答

TA貢獻(xiàn)1815條經(jīng)驗(yàn) 獲得超6個(gè)贊
Ajax 動(dòng)態(tài)無刷新技術(shù) 當(dāng)向后臺(tái)servlet 傳輸數(shù)據(jù)是 做相關(guān)接受 做完處理之后然后用response 吧你需要的想前臺(tái)傳輸?shù)臄?shù)據(jù)寫出去 這里 可以寫xml text html 也可以寫json
然后 ajax 傳輸?shù)姆椒ê?a >回調(diào)函數(shù) 自己用數(shù)據(jù)接受一下就好了
示例代碼:
1 2 3 4 5 6 7 8 9 10 | $(function () { $("#button").click(function( $.post("/login",//傳輸?shù)刂?nbsp;接受地址 {name:$("#name").val(),password:$("#password").val()},//傳遞參數(shù) function(data){//回調(diào)函數(shù) console.debug(data); } }) }) }) |
- 1 回答
- 0 關(guān)注
- 565 瀏覽
添加回答
舉報(bào)