Here is a link to some examples:
Here is a link to a readme about the examples:
When run as a home-screen app on iPod, the canvas is not updated when polling recursively from within the $.ajax() success callback.
In order to fully understand what is going on, please read the readme and test the examples provided. Please look at the source code as well (there is only about three lines difference between the three examples). This must be run as a home screen app on iPod.
Follow these steps to see the bug:
- Go to the first link provided on iPod using Safari
- Visit the first bullet point
- Verify that it works as expected (there should be a moving bug)
- Click the middle button on the bottom row of Safari (bookmark button)
- Click Add to Home Screen and give it a name
- Open the new icon on the home screen
- Wait as long as you like, the bug will not move (if it shows up at all)
Try the other examples in the same manner and verify that they work as expected.
Steps to reproduce
- Put an ajax callback inside of a function
- Update a canvas element from within $.ajax() success callback
- Call the function at the end of the success callback in $.ajax()
- Start the loop
- Do recursive call from within $.ajax() success with setTimeout
- Do recursive call from outside $.ajax() success with setTimeout
The ajax calls are continually made, which means that $.ajax() does not call the error callback. I have verified this on my own webserver by outputting to the console each time an ajax call is made. The only difference is that the canvas is not updated.
I have an app that polls a server and draws the updates to a canvas. In my case, the server has a setTimeout to regulate the update cycle.
- iPod 3g running iOS 4.2.1 (8C148)
- iPod 4g running iOS 4.3.1 (8G4)
Please email me if you would like more information. I will also submit a bug report to Apple about this.