2

I use a jQuery plugin called jscroller, which uses jquery.ajax to make ajax calls. I need to pass in all parameters from a search form, and deliver them to mvc controller, and I think the best way is to put in 'data' field the following expr':

$('#formId').serialize();

My problems is that I need to pass, along with the form values, a 'page' value which is being changed with each call.

How can I put the page value, along with the 'serialize' expression in 'data' field, or is there really another more efficient way to do it?

4

3 に答える 3

6

おもう

var formdata = $('#formId').serialize();
data: (formdata ? formdata + "&" : "") + "page=" + pageId

あなたの問題を解決します

于 2012-06-21T10:22:28.647 に答える
0

私は非常に遅れていることを知っていますが、以下のコードはうまくいきました。

var data = $('#Form').serialize() + '&test=' + number;
$.ajax({
    ....
    data: data;
于 2021-12-19T05:26:34.737 に答える