Reading data outside the 'data' object
Reading data outside the 'data' object
smerchant
Posts: 4Questions: 2Answers: 0
How do I read the data which is outside the data object e.g. client Id and time element which is not a column but just information about the dataset.
Thanks
{
"client_id":"ddddd",
"time":"16:00m",
"data": [
{
"Book": "Mr Smith",
"Author": [],
"Description": "",
}}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It depends where you want to get the data? Assuming you are using
ajax
to get the JSON, then you can useajax.json()
to get the response from the server at some other point.Allan
I am getting a json from GitHub raw data and yes I am using ajax url option. So are you suggesting that I can do something like below to get data var json?
Yep, that would do it - see here: http://live.datatables.net/ruhuguwu/3/edit
Colin
Thanks Colin. That's what I did.