Load Image From URL Error.

Discussion and feedback on Construct 2

Post » Wed Apr 16, 2014 6:59 am

Hi guys..
Help me to fix this problem..
I have build html5 game and try to load image from twitter user_image_url like this
"https://pbs.twimg.com/profile_images/455734542871982080/pNpRQFmk_bigger.jpeg"
to my photo sprite.
but, there is noting and image still empty.
B
4
S
1
Posts: 34
Reputation: 443

Post » Wed Apr 16, 2014 11:29 am

I stand to be corrected, but I think you can only load images from the same server on which your game is hosted.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Wed Apr 16, 2014 12:38 pm

As with cross-domain AJAX requests, the server must respond with the Access-Control-Allow-Origin header to allow cross-domain loading. In this case it looks like you're trying to load an image directly off Twitter's server, and they don't want you to do that because they don't specify Access-Control-Allow-Origin, so it's blocked.
Scirra Founder
B
397
S
236
G
88
Posts: 24,422
Reputation: 194,558

Post » Wed Apr 16, 2014 12:49 pm

alright thank you for replies.. I will try to change the rule of the program.
B
4
S
1
Posts: 34
Reputation: 443


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests