Legend

Forum

Unread topics or posts

Topic

Unread posts

Locked

Announcement

Forums > Developers

Two responses to XMLHttpRequest



AuthorMessage
omastudios

Posted: Jan 30, 2012
Score: 1



Hi,

I've authenticated in my app and I'm trying to get 50 tasks from the API. It's working but I'm getting a duplicate response after each normal response. Here's an output from my logs:


[20120130-16:53:56.758550] info: readystate=4, libs/ajax-0.1.js:53
[20120130-16:53:56.769134] info: undefined: API CALL SUCCESS: 200, /usr/palm/frameworks/enyo/0.10/framework/build/enyo-build.js:72
[20120130-16:53:56.769583] info: undefined: got tasks: <<<LONG JSON STRING>>>
[20120130-16:53:56.783836] info: readystate=4, libs/ajax-0.1.js:53
[20120130-16:53:56.784190] info: undefined: API CALL SUCCESS: 200, /usr/palm/frameworks/enyo/0.10/framework/build/enyo-build.js:72
[20120130-16:53:56.784520] info: undefined: got tasks: <<<LONG JSON STRING>>>, /usr/palm/frameworks/enyo/0.10/framework/build/enyo-build.js:72

The two "readystate=4" logs are made in the onreadystate method of the XMLHttpRequest meaning it isn't an error in my code. The platform is stable (v8/webkit) so I assume the API must be returning two responses to the same request. The details, including the returned tasks, are identical for both responses.

Any help would be appreciated as the duplicate is causing some nasty bugs in my app.

Cheers,

Jack
omastudios

Posted: Jan 30, 2012
Score: -1



Please disregard. Turns out two instances of my library are being created (running separate requests) so everything that one does is duplicated by the other.

Sorry!
You cannot reply yet


To participate in these forums, you must be signed in.



Toodledo Forums > Developers

Contact Us | Blog | API | Jobs | Press | Documentation | Forums Privacy | Terms | Copyright © 2004-2014