Send list/array as parameter with jQuery getJson

前端 未结 4 1569
攒了一身酷
攒了一身酷 2020-12-13 10:06

I have the following where I\'m trying to send list/array to MVC controller method:

var id = [];
var inStock = [];

$table.find(\'tbody>tr\').each(functio         


        
4条回答
  •  攒了一身酷
    2020-12-13 10:22

    Unfortunately, while it seems that jquery provides a "traditional" flag to toggle this behavior on jQuery.ajax, it does not on jQuery.getJSON. One way to get around this would to be set the flag globally:

    jQuery.ajaxSettings.traditional = true;

    See the documentation for jQuery.param: http://api.jquery.com/jQuery.param/ Also see the release notes for this change: http://jquery14.com/day-01/jquery-14 (search for 'traditional')

提交回复
热议问题