- This topic has 2 replies, 2 voices, and was last updated 12 years, 2 months ago by
Unknown Author.
-
AuthorPosts
-
Unknown AuthorParticipantNoticed some odd app behavior and am wondering whether anyone more-expert in web programming can tell me a cause and possible solution.
My app is designed so that, when a button is pressed, multiple Ajax calls will occur, then those results will be thrown into a custom list. The custom list does not generate until all the Ajax calls recieve a response (recursive waiting). It is an iOS native app. I am testing on an iPhone 4S.
On AT&T, this works reliably and repeatedly. Ajax responses are captured and the list page is generated. On WiFi (Comcast, through my home router), this works only once. The second Ajax group of requests will cause the app to hang, as it’s not getting all the responses back that it needs.
Has anyone encountered this before? Is it a Comcast thing for iOS apps? When I do the requests from Test Center on my PC, it has no issues.
-1TC
UPDATE: Am now investigating a timing issue, as puting an “alert(results)” into every Ajax “sucess:” has slowed the app down to work properly. I’m thinking there’s a timing issue in calling the page transitions too quickly. Calling the transition to the results page before the call to the “please wait” page is complete.
UPDATE 2: I think I introduced a race condition by puting gotopage commands (based on completion of Ajax calls) in pretransition code. I have moved the code block to posttransition and am seeing better performance.
support-octavioMember@1thinchip,
We are not aware of any network specific problems with ajax calls. I typically avoid alerts in such code, instead use console.log() except on ios6 where Apple removed the javascript console (crap!). For ios6 debugging we have been using debug.phonegap.com and chrome.
Unknown AuthorParticipantIt turned out to be a race condition caused by a gotopage inside the pretransition function. I moved the gotopage to the posttransition function and it’s all working now.
How long before donij comments that this thread is a waste of “experts” time?
-
AuthorPosts