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
30
S
13
G
7
Posts: 740
Reputation: 7,994

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
30
S
13
G
7
Posts: 740
Reputation: 7,994

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
378
S
220
G
84
Posts: 23,868
Reputation: 188,111

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
30
S
13
G
7
Posts: 740
Reputation: 7,994

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: justintime0185, oddreal, TRMG, twomonocles, wmsgva and 8 guests