danju92's Recent Forum Activity

  • I think what he is having trouble with, is getting the game to read a json or xml file from an external server(url). An issue I was having as well at one point. By default, browsers are set to block those request, so you have to give that permission manually.

    I think this is what your after? Copied from tutorial.

    Making AJAX requests cross-domain or in preview

    By default, browsers block AJAX requests across domains. This means, for example, a game on scirra.com can request other pages on scirra.com, but cannot request pages on facebook.com. This is an important security feature of web browsers (it is not specific to Construct 2 or its AJAX object).

    Also, when previewing in Construct 2 the game runs on localhost. This counts as a different domain to the rest of the internet, so typically AJAX requests to any web page will fail during preview, unless the server explicitly allows cross-domain requests.

    *** (this part is the trouble. Lack of explanation here down)****

    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:

    Access-Control-Allow-Origin: *

    This will enable AJAX requests from any domain, but you should still be aware of the possible security implications of this. For more information on cross-domain requests see HTTP access control on MDN.

    Thx so much for all!!

  • I'm here for learn but the tutorials can't help me.

    How can i learn it if the guide is incomplete?

    And you talk and write but do nothing for help me.

  • [attachment=0:16lgvtrj][/attachment:16lgvtrj]

    I've just read it.

    But don't work T_T

  • Yes i've read but it's usless.

    I don't want download file from the website.

  • There are more than one API in this site.

    And i need send some informations on input...

    I can't use CSV

  • No one can help me?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've some problems with AJAX and CROSS DOMAIN request.

    I've just add al necessary code in my php website.

    I've added this

    header('Access-Control-Allow-Origin: *');[/code:2ab5fa8e]
    
    and this on htaccess
    
    [code:2ab5fa8e]<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    </IfModule>[/code:2ab5fa8e]
    
    I've made an ajax reqeust but there are no response.
    
    Response is blank.
    
    Someone can help me please?
  • UP

  • I've just tried with this two tutorial.

    But didn't work.

    Someone can try and post correct code pls?

  • UP

    No one can help me?

  • Hi guys.

    I've found an API for a MMORPG.

    This site distribute an API in this format

    census.soe.com/s:example/json/get/ps2:v2/character

    or

    census.soe.com/s:example/xml/get/ps2:v2/character

    How can i take this content and read in my app?

    Thanks so much for all

  • UP!

danju92's avatar

danju92

Member since 15 Jan, 2015

None one is following danju92 yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies