Hi guys!
I'd appreciate any insight here. I have a datatable which uses JSON data and pulls via AJAX.
The goal is to utilize data from arrays with unique key values. Unfortunately, I only get [object Object] as the response.
What would be the best way to pull such data?
Here is my code:
Javascript:
HTML:
Name |
---|
JSON:
{
"data":[
{
"CVS":[
{
"name":"lisinopril"
},
{
"name":"adderall"
}
]
},
{
"Costco":[
{
"name":"ibuprofen"
},
{
"name":"methylphenidate"
}
]
}
]
}
Ultimately, each primary category (CVS, Costco, etc) will have multiple keys, such as 'dosage', but I simplified the code to make it easier to understand what I'm looking to do.
Admittedly, I'm only just now learning the basics of Javascript, let alone libraries/frameworks like datatables, so I sincerely apologize for my lack of understanding. Again, any help/input is highly appreciated.
Thanks,
-Dave