Monday, March 21, 2011

AJAX Schizophrenia on iPhone

I have encountered a weird ajax javascript behavior on HTML5/iPhone/safari. It succeeds when the code is included inline in the body of the script tag, but fails to retrieve data when the same code is referenced using src. The failure is in returning empty string in the ajax xhr responseText with OK status.

This is apparently a symptom of cache-manifest sync-ing restrictions along with iPhones inaccurate communication indication. The client never communicated with the server even though the network spinner indicated otherwise. The iPhone client was talking to itself like Norman Bates and reporting responses instead of errors. The faulty wiring was caused by cache-manifest behavior that blocked communication with the server.

1 comment:

  1. I think the same restriction applies to scripts loaded from local sqlite.

    ReplyDelete