danju92's Forum Posts

  • 14 posts
  • 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?

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!

  • no one can help me?

  • Hi guys and sorry for disturb

    In my new program i try to save a text file on my computer/mobile device.

    But i don't know if it is possible and how i can do it.

    Someone can help me with this?

    Thx so much.

  • 14 posts