我这里有一个问题,不知道如何解决它......
我有一个这样的json文件:
{"data":[{"kw":"48","val":"10","val2":"05"},{"kw":"49","val":"04","val2":"05"}]}
但我需要这种格式:
[{"kw":"48","val":"10","val2":"05"},{"kw":"49","val":"04","val2":"05"}]
在 javascript/jQuery 中,我发出 ajax 请求并取回 json:
$.ajax({
type : "POST",
cache : "false", // DEBUG
url : weburl,
dataType : "json",
contentType : "application/json; charset=utf-8",
success : function(data) {
// Strip data?
}
});
有谁知道如何做到这一点?谢谢!