How do I use AJAX On Completed ?

0 favourites
  • 3 posts
From the Asset Store
A whole set you need to create a gorgeous winter 2d game
  • Hi !

    I think I am not using some features of Construct 3 correctly.

    I would like to check the status of an HTTP request and react based on the HTTP return code of my request.

    Here, I expect that if I get an HTTP return code 200, the program will open the "Scene page" layout, and if the return code is HTTP 401, it will erase the token entry from LocalStorage.

    Unfortunately, this is not working.

    I have used Text objects for debugging and locating where the problem is, and I realized that it is the condition 5 AJAX - On "getUser" completed that is never executed, even though the tag is perfectly placed on condition 3.

    Do you have any idea, please, because I admit that I am stuck here?

    Thank you in advance,

    Frederic

    Tagged:

  • Your header should be set before making the ajax request.

    I do not know if that is the reason you are not getting a response/ajax completed, but seems like it could be.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your header should be set before making the ajax request.

    I do not know if that is the reason you are not getting a response/ajax completed, but seems like it could be.

    I just followed your advice, but unfortunately, it doesn't change anything. ;-(

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)