I have开发者_开发百科 a HTML5 app that uses websql for storing data.
Where possible, I'm using the readTransaction() method for read-only SELECT queries, and the transaction() method for INSERT/UPDATE/DELETE queries.
I'm not sure if there's a performance benefit to using readTransaction(), but it seems like the right thing to do.
The app works fine on desktop Safari, Chrome, iPhone (iOS4)...but on the iPad (iOS 3.2), it doesn't. When I enable the debug console (Settings -> Safari -> Developer -> Debug Console), I can see that it's complaining that there's no readTransaction() method.
Can anyone confirm if the iPad only supports a subset of the HTML5 database API? Obviously the easy fix is to change all readTransaction() calls to transaction(), but I just was wondering if anyone knows why readTransaction() doesn't work on the iPad?
I can't find any reference to this discrepancy on developer.apple.com or anywhere else.
In order to get the confirmation, you have to cross several informations:
1) The User-Agent string for an iPad 3.2 is the following:
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
2) Safari 4.0.4 for iPad was released on April 2010, the 3rd (see http://en.wikipedia.org/wiki/Safari_version_history)
3) readTransaction
was commited to the WebKit trunk on September 2009, the 9th (see http://trac.webkit.org/changeset/48227)
This is why the WebKit engine that power Safari 4.0.4 for iPad 3.2 does not support readTransaction
.
Not sure I follow your logic here...you're saying that support for readTransaction was commited to the repository 15 months ago (Sep 09); and that the version of Safari in iOS3.2 was released 8 months ago (Apr 10)?
Unless I misunderstand you, that would mean that readTransaction support would have already been in the trunk for 7 months at the point Safari 4.0.4 was released.
Are you confusing Sep 09 with Sep 10, perhaps?
精彩评论