How can I display json formatted data receiving from ajax

Get help using Construct 2

Post » Mon Apr 06, 2015 8:23 am

I am trying to display some data coming from php ajax
How can I display json formatted data receiving from ajax,
Below is my formatted json
{
"c2array":true,
"size":[1,6,4],
"data":[
[[4837],["test2"],[2],["1"]],
[[700],["test6"],[6],["5"]],
[[600],["test1"],[1],["4"]],
[[30],["test1"],[1],["3"]],
[[10],["test1"],[1],["1"]],
[[10],["test1"],[1],["2"]]]
}

I am trying to store data inside array,but i am not sure it is coming inside or not.
Trying to print out data using array.at(0,0,0) also tried with str(array.at(0,0,0))
Please
Please
Please suggest,how to manage this one :( :( :( :(
Last edited by dapankaj on Tue Apr 07, 2015 2:57 am, edited 2 times in total.
B
3
Posts: 6
Reputation: 187

Post » Mon Apr 06, 2015 4:13 pm

Review the attached .capx at this thread...

viewtopic.php?f=147&t=128012&p=903024&hilit=json#p903024
B
14
S
3
G
3
Posts: 39
Reputation: 2,642

Post » Tue Apr 07, 2015 2:22 am

Hi,
@redrocket, thnx for your response
I was already following your post,
But cannot see updated .capx file, that one in not receiving response inside text.

Please suggest how to access data with data position

Thank you
B
3
Posts: 6
Reputation: 187

Post » Wed Apr 08, 2015 1:48 am

After receiving the JSON response from the AJAX plugin, the JSON response is going to have to be put into an array. There is the Array, Hash, Dictionary, Table, and even a JSON plugin which should accomplish this. Once you load the JSON data into the array of your choice, you can use that plugin's functions to access the data position.
B
14
S
3
G
3
Posts: 39
Reputation: 2,642


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest