AJAX request

Get help using Construct 2

Post » Sun Jun 02, 2013 11:51 am

I have a problem with AJAX request. I have made an account to 000webhost.com and uploaded a JSON file from my game, using php. AJAX loads the code from the web page, but it gets a nasty footer with it, that is not allowing me to put the ajax.lastdata to an array.

{"c2array":true,"size":[4,4,1],"data":[[["Roof"],[317],[400],[0]],[["Roof"],[435],[405],[0]],[["Roof"],[538],[405],[0]],[["Roof"],[630],[415],[0]]]}
<!-- Hosting24 Analytics Code -->
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
<!-- End Of Analytics Code -->

Is there a way to remove it or should I change the web host.

Link to my file:
http://thegong.comlu.com/save.phptrollface2013-06-03 15:06:52
B
14
S
6
G
4
Posts: 107
Reputation: 4,838

Post » Mon Jun 03, 2013 3:05 pm

bump
B
14
S
6
G
4
Posts: 107
Reputation: 4,838

Post » Mon Jun 03, 2013 5:36 pm

Try using tokenat(AJAX.LastData, 0, "<!--"). It should get rid of the excess data.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Mon Jun 03, 2013 6:32 pm

Thanks mate, you saved me a lot of nerve wrecking and my user-side game editor is now fully operational.
B
14
S
6
G
4
Posts: 107
Reputation: 4,838


Return to How do I....?

Who is online

Users browsing this forum: David181, yiuyiu6666 and 24 guests