How do I send array over AJAX as part of JSON message

Get help using Construct 2

Post » Sun Jan 17, 2016 7:39 pm

Hi, guys. Please tell me, how can i do this thing: i need to post on server JSON like this - {cmd: 'choosePlayers',choiceId: 3, choice: [1,2,3]}. [1,2,3] - this must be array from Construct2, but i can only use Array.AsJSON and in this way it looks like
{cmd: 'choosePlayers',choiceId: choice: {
"c2array": true,
"size": [1,1,0],
"data": [
[[13]],
[[14]]
]
}
}
in this case i get parse error. sorry for bad english
B
3
Posts: 2
Reputation: 179

Post » Sun Jan 17, 2016 8:57 pm

So parse the array yourself into the format you need, if you can't change it on the other end.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Jan 18, 2016 6:19 am

mindfaQ wrote:So parse the array yourself into the format you need, if you can't change it on the other end.

i cant even receive the message. Express(using Node.JS as server) give me error before then i can do something with it. i can try to change something in Express module, but maybe there are other ways?
B
3
Posts: 2
Reputation: 179


Return to How do I....?

Who is online

Users browsing this forum: GabrielBalas, imhotep22, whitephon and 4 guests