Using AJAX to update data in a database

0 favourites
  • 5 posts
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • Hello everyone,

    I made a MMO browser-based game SDK with C# & ASP.NET which primarily interacts with Adobe Flash. However, since my SDK is now almost six years old, it is time to update it, since when it was first released mobile phones were not the powerful pocket-computers we see today. So therefore, I want to drop Flash entirely and update my SDK to use HTML5 too more actively target mobile phone users. (Hell, the 'mobile versions of my games are basically just text at the moment!). Initially I was going to develop my own HTML5 back-end, but with Construct 2 progressing in such a way it would be much cheaper (And faster!) to integrate Construct 2 with my C# back-end and use C2 for my HTML5 needs.

    However, I have a question regarding the AJAX object. When you pass a Request to a file, will the code behind of that file be processed? As an example, say I want to collect the strength of a unit from a database I would pass along something like this:

    domain.com/gatherunitdata.aspx?unitid=17

    So that page takes the unitid of 17, connects to a database and returns the data as page content for Construct 2 to then use in the application. Would this work, or would Construct 2 just go to gatherunitdata.aspx and find a blank page?

    Thanks ^^

  • If you have correctly coded the aspx page, it should work.

    You can check out the tutorial about AJAX (the example is given in PHP, but the logic from the server-side is the same, you just have to code it correctly in whatever language you want).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The AJAX object is like requesting the page in your browser. So the code for the page runs and returns the page content like usual!

  • I purchased a business license for future use and I will play around with it some more. Are there any plans to update the AJAX object? Such as adding AJAX POST or being able to more easily read the returned GET data?

  • Yeah, hopefully we'll add posting and XML posting in future, it's just we have a long todo list right now! Hopefully it has enough basic functionality for the time being.

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