function bar()
});}
這個方法呼叫以後,在瀏覽器控制台裡,發現提交的url是jquerytest.html?choices%5b%5d=a&choices%5b%5d=b&choices%5b%5d=c,
這是因為在ajax傳送請求之前,會呼叫jquery.param()把data轉換成字串,choices是個陣列,在jquery 1.4以後,就變成了choices%5b%5d=a&choices%5b%5d=b&choices%5b%5d=c的樣子.
但是這樣在後台就找不到"choices"這個請求引數了.
不過可以用traditional這個引數控制一下.
function bar() ,
traditional : true
});}
url終於變成了jquerytest.html?choices=a&choices=b&choices=c
JQuery AJAX 提交js陣列
例如 var data no 001 name 張三 score 80,75,82,66,70 post url,param data,true callbackfunc jquery.param object,traditional 引數 描述object 要進行序列化的陣列或物件。traditi...
Jquery ajax方式提交表單
jquery ajax方式提交表單,目前用過的有兩種方式 1 引人jquery.js和jquery.easyui.min.js後,用下面的方法 checkform1 form submit urlhidden value e j j.length e index html j.length docu...
jquery ajax提交中文亂碼問題
post jquery提交中文引數服務端獲取的引數成亂碼問題 對傳輸的中文引數進行編碼 var namecon encodeuricomponent idname val post selectresult.do?method selectexecute4 function data text 在伺...