DataTable to Json using jquery

前端 未结 9 1211
抹茶落季
抹茶落季 2020-12-16 05:48

I\'m trying to execute a web service which returns a DataTable with the following piece of code:

$.ajax({  
    type: \"POST\",  
    url: url,  
    data: d         


        
9条回答
  •  既然无缘
    2020-12-16 06:03

    I must admit I'm not hugely surprised - DataTable basically breaks most of the rules of structured data. Why not simply project from the data-table into a typed object? A related question came up earlier... or if you know the schema of the DataTable just do the conversion in C#...

    Manually building the JSON might work, but there are a lot of edge-cases to avoid; I'd rather let an existing framework handle it, to be honest.

提交回复
热议问题