今天心情很好,終於寫出來了用ajax非同步獲取資料,不重新整理頁面。
後台方法:
前台ajax:
$("#sub").click(function(),
function(rtn);
var json = (new function('return '+rtn +';'))(); //json字串變成json物件
alert(json);
var text='';
$(json).each(function());
alert(text);
$("#spacelist").html(text);});
});
在後台拼接出來的字串10個物件:[,,,..........]
[,"wantnum":"1","website":""},,"wantnum":"1","website":""},,"wantnum":"2","website":""},,"wantnum":"3","website":""},,"wantnum":"6","website":""},,"wantnum":"3","website":""},,"wantnum":"3","website":""},,"wantnum":"1","website":""},,"wantnum":"1","website":""},,"wantnum":"1","website":""}]
spring中jso檔案獲取後台資料時注意的點
var tr s.baby id tr s.baby name tr s.baby age tr s.baby gender tr s.baby gender 1?男 女 tr s.baby member tr s.balance tr 洗澡 充值 tr layui.tbody tr 不知道是不是我...
前台資料通過ajax傳到後台 作用 AJAX學習
ajax需要建立乙個xmlhttprequest物件,具體呼叫方法為new xmlhttprequest 但是值得一提的是 在ie7以上的版本,有以上方法,到了ie7以下,想要乙個xmlhttprequest物件需要new activexobject 判斷方法為 想要通過ajax讀取資料,就需要使用...
使用ajax與js查詢後台資料
請輸入你要查詢的編號 查詢 設定頁面內容是html編碼格式是utf 8 header content type text plain charset utf 8 header content type text xml charset utf 8 header content type text h...