How do I can read a external JSON or XML file?

Get help using Construct 2

Post » Thu Jul 09, 2015 9:34 pm

Yes, I agree.

As @Jermfire , how does one request an XML from an URL which is hosted on a server? Like many, I have not been able to find a clear solution to this, most tutorials only demonstrate through project file import.
B
104
S
19
G
8
Posts: 155
Reputation: 11,566

Post » Thu Jul 09, 2015 10:49 pm

Access-Control-Allow-Origin is a response header, it's the server that allows it or not. You can't as a mere client tell the server to allow for cross-domain request, that would entirely defeats the purpose of cross-domain policy. :P

The only solution is to have access to server configuration, and add that custom header there.
B
62
S
26
G
24
Posts: 954
Reputation: 18,318

Post » Sun Jul 19, 2015 5:26 pm

Magistross wrote:Access-Control-Allow-Origin is a response header, it's the server that allows it or not. You can't as a mere client tell the server to allow for cross-domain request, that would entirely defeats the purpose of cross-domain policy. :P

The only solution is to have access to server configuration, and add that custom header there.


When the answer hits you like a baseball bat to the head and you're just like: "Derp! Dummy self! You should have known that! wth were you thinking!!!"


Let me clarify what was going on...

We have a new house with a newer garage(Server). Got a cool car(Client/ C2Game).
The garage has a cool lock that can detect only your car and let it in...as long as you set it up.

We were trying to set the code for the car...in the car itself and bash it into the garage door, wondering why it wont open. Lovely.

I think it's in part of the feeble description that's confusing to noobs.
B
9
S
2
Posts: 80
Reputation: 854

Post » Mon Jul 20, 2015 1:53 pm

Yep, the following sentence might be the culprit :
TFM wrote:If you want AJAX requests to your server to work from any domain, or in preview, you can configure it to send the following HTTP header
What does "it" refer to, the server, the request, the AJAX plugin ? It seems to assume you know what a response header is and where it should be configured.
B
62
S
26
G
24
Posts: 954
Reputation: 18,318

Previous

Return to How do I....?

Who is online

Users browsing this forum: DolyGamesCosmos, FabianB, Vodakman and 12 guests