jq如何上傳參數(shù)?
1.jq是通過(guò)ajax上傳
$.ajax({ url: "test.html", context: document.body, success: function(){ $(this).addClass("done"); }});2.通過(guò)form表單提交
$(function() { $('#submit').click(function() { var d = {}; var t = $('form').serializeArray(); //t的值為[{name: "a1", value: "xx"}, //{name: "a2", value: "xx"}...] $.each(t, function() { d[this.name] = this.value; }); alert(JSON.stringify(d)); }); });