I'm using Django as back-end,in my view.py I return a json object as
return HttpResponse(json.dumps(result))
and in my front-end, in a javascript file I received with
jsonResult = JSON.parse(result);
it is successful cause I can see the variable "jsonResult" if I use the console to check it, just as:
console.log(jsonResult);
The problem is that I want to see its format, as something like this:
{
"tags":{
"tag":[
{
"time":"67",
"comment":"test 2",
"id":"18",
"owner":"xiaoli",
},
{
"time":"30",
"comment":"",
"id":"28",
"owner":"xiaoli",
}
]
}
}
How can I do this? Or if I can generate a json file? Thanks.