Asp.net Mvc Ajax Json (post Array)

前端 未结 2 841
南方客
南方客 2021-01-14 01:21

javascript\\jQuery:

 var items = new Array();

 var obj { Begin: \"444\", End: \"end\" };

 items.push(obj);
 items.push(obj);

  var request = {
                    


        
2条回答
  •  执念已碎
    2021-01-14 01:27

    Try write code as below:

    var option = {
      url: '/Home/Index',
      type: 'POST',
      data: JSON.stringify(request),
      dataType: 'html',
      contentType: 'application/json',
      success: function(result) {
        alert(result);
      }
    };
    $.ajax(option);
    

提交回复
热议问题