CocoonJS posting Ajax with data

Bugs will be moved here once resolved.

Post » Fri Sep 06, 2013 5:53 am

Ashley, sorry. I think your first response will be to close this since this IS a CocoonJS bug and they should fix it. But I also remember there was the long standing AJAX issue with CocoonJS but you added the workaround that fixed it for many eager users. Since you're much more responsive I figured I would ask for your help first.

I've included my node JS server paired down to the base functionality. If you want to me host it externally so you can test please let me know and I will.

Link to .capx file (required!):

Node.js server included:

Steps to reproduce:
1. Start node.js server
2. Start the capx in preview mode.
3. Click the green square.

Observed result:
The text box remains as "Text".

Only the "Starting..." message is seen in the console.

Expected result:
The text should change to the response from the server. In the case of my node.js server it would be. "You've sent the text: test"

Possibly seeing the progress message in the console.

Seeing the "Done!" message in the console.

Browsers affected:
Chrome: no
Firefox: no
Internet Explorer: Unable to test. I only have IE8 on this PC and I cannot upgrade. Sorry!
Mobile Chrome on Android: no
Opera: no
Mobile Safari on iOS6: no
Mobile Android browser:no

Operating system & service pack: Windows 7

Construct 2 version: 139

The strange things about this issue is if I set the data in the Ajax post to "" [sending no data] I am able to get a response in CocoonJS! I wonder if it's related to this error I also see in the console from Chrome 29.

I'm in a pinch. My nodeJS server is working and I have hosting with appfog/Openshift about ready[still comparing the two. :)]. I just have this error preventing me from pushing to the Play store and App store.

Thank you for your help and let me know if ANY other information is needed!basspenguin2013-09-06 05:55:05
Posts: 159
Reputation: 8,351

Post » Fri Sep 06, 2013 12:50 pm

I think it might be a mistake in the AJAX plugin. Try deleting that line (which calls setRequestHeader for Content-Length) and see if it works. I've removed that line for the next build; I've read the specification does not actually allow that header to be set.
Scirra Founder
Posts: 24,931
Reputation: 198,725

Post » Sat Sep 07, 2013 5:20 am

Removing that line FIXED IT! Thanks man. :)
Posts: 159
Reputation: 8,351

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 12 guests