开发者

send array + vars with Jquery ajax

Trying to send array + vars with Ajax, Sending just the array worked fine...but开发者_StackOverflow社区 when trying to add the vars i get empty in response.

var ar = $("select#galaddvenn").serialize();
    var kat = $('input[name=kat]').val();
    var bppuid = $('input[name=bppuid]').val();
    j.ajax({
    data: ({'ar':ar,'kat':kat,'bppuid':bppuid}), //test normal mode..array works with: data: ar, 
    dataType: "html",


.serialize() returns a POST-string, in the form of a=1&b=2&c=3&d=4&e=5, so try the following instead:

var ar = $("select#galaddvenn").serialize();
var kat = $('input[name=kat]').val();
var bppuid = $('input[name=bppuid]').val();

ar += '&kat=' + kat;
ar += '&bppuid=' + bppuid;

j.ajax({
 data: ar,
 dataType: "html",

[...]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜