AJAX call returns both OnCompleted and OnError triggers

0 favourites
  • 4 posts
From the Asset Store
Game Triggers is as versatile as a Swiss army knife, and will be a great resource for any type of game you're creating.
  • Problem Description

    Ajax request for a php file returns both OnCompleted and OnError triggers

    Attach a Capx

    https://www.dropbox.com/s/ew45o51qaa25d ... .capx?dl=0

    Description of Capx

    Ajax request for a php file returns both OnCompleted and OnError triggers.

    The call itself works (you can check it here: https://www.app.insanenumbers.com/Insan ... erid=12112).

    It returns a string "newuser".

    Steps to Reproduce Bug

      Just open the project in debug mode, it inmediatle calls the ajax request on start of layout.

    Observed Result

    Both variables sPrueba3 and sPrueba4 are 1, and you can see that each one is set on a separate triggers, whichs means that both triggers are called.

    Expected Result

    It should only return one trigger, either the ajax was OK or NO, but not both.

    It only happens in Chrome and Internet Explorer, in firefox is all OK.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (NO)
    • I.E: (YES)[/

    Operating System and Service Pack

    Windows 7 Ultimate Service Pack 1

    Construct 2 Version ID

    212.2

  • Sorry there was a problem with the capx, now it is Ok.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well doing some changes to the plugin and some proves, I can assure the problem is here: (open runtime.js inside the ajax plugin (C:\Program Files\Construct 2\exporters\html5\plugins\ajax\runtime.js)

    line 197: request.onerror that triggers this:

    line 127: var errorFunc = function (err) where err in this case is :

    [object XMLHttpRequestProgressEvent]

    As a provisional solution I will make an if (err = "[object XMLHttpRequestProgressEvent]") return.

    But anyone knows why this happens? And why not in Firefox?

    Thanks,

    Sergio

  • Should be fixed in the next build.

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