Help with ajax call?

Discussion and feedback on Construct 2

Post » Sat Dec 07, 2013 6:48 pm

Hi

I made a game that get a set of question from a web service, and I will export it to andrid with cocoonjs.
but when i try to get the questions, it shows me an acces cros domain error.

is there a way to solve this problem from the client side?
its because I have no acces to the server administrator.
B
9
S
4
Posts: 49
Reputation: 1,239

Post » Tue Dec 10, 2013 2:03 am

Sorry but no...

You need to modify the header response server side.

<?php
//Allows all AJAX requests from any domain
header('Access-Control-Allow-Origin: *');

?>
CAUTION!
If you add this it will allow all requests from any domain that this website is not hosted on. I would recommend you do more reading on this before using it. But if you don't have access to the server then its kinda moot any way.

Curious though your sending an Ajax request to a server you don't even have access to?
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Fri Dec 27, 2013 3:51 pm

thanks troublesum.

yes I am sending an Ajax request to a server that I don't have access to :S
B
9
S
4
Posts: 49
Reputation: 1,239


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests