Ajax and Google Web Store problems

Get help using Construct 2

Post » Wed Jan 18, 2012 12:35 pm

Hi!
Published app to Googles web store is not working with ajax.
Is it a bug or i have to change something in capx?

Ajax and Google Store test

Link to php file
B
19
S
3
G
5
Posts: 98
Reputation: 4,647

Post » Wed Jan 18, 2012 12:47 pm

the PHP script has to be on the same domain as the exported project otherwise it doesn't work. If you try to call a PHP script on your server when the game is hosted by Google, then the PHP is not, Hense its not working

Hope that helps .
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Wed Jan 18, 2012 1:11 pm

thx!
is there any way i can call a PHP script from other server?
B
19
S
3
G
5
Posts: 98
Reputation: 4,647

Post » Wed Jan 18, 2012 1:17 pm

No easy/quick way i can think of. Try post another thread asking that..

you could allways call it using the call javascript plugin i guess. But then you would have to figure out how to parse it..
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Wed Jan 18, 2012 1:30 pm

AJAX requests cross-domain are blocked by default. However, you can set up your server to accept cross-domain requests. See AJAX in the manual for the details.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Wed Jan 18, 2012 1:37 pm

thx
B
19
S
3
G
5
Posts: 98
Reputation: 4,647

Post » Wed Jan 18, 2012 3:30 pm

Its working thx a lot! [<:o)]
B
19
S
3
G
5
Posts: 98
Reputation: 4,647

Post » Wed Jan 18, 2012 3:42 pm

How did you get it working?
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Wed Jan 18, 2012 3:45 pm

i put this:

header('Access-Control-Allow-Origin: *');

to my php script.
B
19
S
3
G
5
Posts: 98
Reputation: 4,647

Post » Wed Jan 18, 2012 3:47 pm

check this post Cross-domain
B
19
S
3
G
5
Posts: 98
Reputation: 4,647

Next

Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 18 guests