Load PHP json into Dictionary

Get help using Construct 2

Post » Tue Dec 24, 2013 6:58 pm

Hello y'all,

I am having problems to load into the dictionary a json returned from a php page.

I have already checked the cross-domain header on the php. The PHP is working fine and I'm storing the Ajax.LastData into a variable which is displayed in the debug having the following value:{"id":"2","pergunta":"2*2","resposta":"4"}
This same value is not loading when i call the Load on the dictionary.
The php content-type is also set to application/json.

What am I missing?
B
3
S
1
Posts: 6
Reputation: 537

Post » Tue Dec 24, 2013 9:00 pm

You cant load a json if all keys in the dictionary are not set before load.
B
38
S
13
G
4
Posts: 152
Reputation: 5,147

Post » Wed Dec 25, 2013 1:17 pm

Thanks for the help Anata.
I added the keys to the dictionary at the start of the layout but I still can't load the json in it.
B
3
S
1
Posts: 6
Reputation: 537

Post » Wed Jan 08, 2014 3:38 pm

I still struggle with the Json.
Any suggestions of how the actions should be like, or maybe the json string has something wrong?
B
3
S
1
Posts: 6
Reputation: 537

Post » Wed Jan 08, 2014 3:54 pm

I have found my error which was in the sintax of the dictionary c2 uses. :)
B
3
S
1
Posts: 6
Reputation: 537

Post » Thu Oct 16, 2014 2:24 am

brunopf wrote:I have found my error which was in the sintax of the dictionary c2 uses. :)


Care to shed some light on that syntax?
B
9
S
1
Posts: 33
Reputation: 612

Post » Thu Oct 16, 2014 10:28 pm

Nevermind, I figured it out. I didn't realize you needed to load the keys in the dictionary ahead of time.
B
9
S
1
Posts: 33
Reputation: 612


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 6 guests