Add data to JSONObject

后端 未结 3 1749
刺人心
刺人心 2020-12-05 05:09

I\'m trying to figure out how to add the following data to my json object. Could someone show me how to do this.

Website Example

$(document).ready(f         


        
3条回答
  •  清歌不尽
    2020-12-05 05:27

    The answer is to use a JSONArray as well, and to dive "deep" into the tree structure:

    JSONArray arr = new JSONArray();
    arr.put (...); // a new JSONObject()
    arr.put (...); // a new JSONObject()
    
    JSONObject json = new JSONObject();
    json.put ("aoColumnDefs",arr);
    

提交回复
热议问题