Use variable name on Ajax data Post

Get help using Construct 2

Post » Mon Aug 12, 2013 10:06 pm

I need to send data on a variable as if I was doing

"http://myurl/maps?map=mapdata"

in order to receive it on my server as

map: mapdata

Is there any way to do this?


That's how i'm using it



B
23
S
3
G
5
Posts: 10
Reputation: 4,302

Post » Mon Aug 12, 2013 10:16 pm

JSON can't be passed as a query string, unless serialized in the proper format. But you probably shouldn't do that for large objects, like big map arrays, since you will most likely exceed the request length limit.Magistross2013-08-12 22:23:37
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Mon Aug 12, 2013 10:37 pm

Yep i know i cant pass json as a query string, but maybe there was some way to send 'data' on a variable. But you are right even if that was possibly, maybe it exceed the query string length limit.
B
23
S
3
G
5
Posts: 10
Reputation: 4,302

Post » Mon Aug 12, 2013 11:50 pm

I just solved in this way



I dont like the solution but it that way I got all data from my array came under the map parameter.

It would be great if anyone knows a better way to accomplish this, share it.

There was no problem with the size of json, I tried [150, 150, 5] size and there was no problem.aguzz2013-08-12 23:58:16
B
23
S
3
G
5
Posts: 10
Reputation: 4,302


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests