AJAX call returns both OnCompleted and OnError triggers

Bugs will be moved here once resolved.

Post » Thu Aug 27, 2015 2:57 pm

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)[/
    [/list]

Operating System and Service Pack
Windows 7 Ultimate Service Pack 1

Construct 2 Version ID
212.2
Last edited by jugger87 on Fri Aug 28, 2015 2:49 pm, edited 2 times in total.
B
8
S
2
Posts: 42
Reputation: 649

Post » Fri Aug 28, 2015 1:45 pm

Sorry there was a problem with the capx, now it is Ok.
B
8
S
2
Posts: 42
Reputation: 649

Post » Sun Sep 06, 2015 8:57 pm

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
B
8
S
2
Posts: 42
Reputation: 649

Post » Tue Sep 08, 2015 4:02 pm

Should be fixed in the next build.
Scirra Founder
B
402
S
238
G
89
Posts: 24,644
Reputation: 196,095


Return to Closed bugs

Who is online

Users browsing this forum: SEGamestudio and 2 guests