Search code examples
javascriptiosipadios6mobile-safari

JavaScript not working in Safari on iPad


We have a large web application and we have found that it is not working properly in Safari on an iPad. Although we have an iPad for testing, it doesn't seem to be possible to see JavaScript errors in Safari on it. The Web Inspector feature seems to need a Mac, which we don't have.

Go to https://desktoplawyer.secureclient.co.uk/dtl/index.cfm?event=base:tryDocument&rapidocsid=5700, click Next, click "England and Wales", click Next: every other browser now takes you to a page entitled "Preliminary questions", but in Safari on the iPad it stays on the page entitled "Domicile".

What are my options? And please don't just tell me that we have to buy a Mac ;-)


Solution

  • Something similar happened to me not too long ago. Try adding the following header on the server side responses to POST requests and see if it works:

    Cache-Control: no-cache
    

    The thing is, starting from iOS 6, Safari Mobile caches AJAX POST methods with an identical function signature. This means that the method will only be performed once and the server's response will be saved and reused for several additional requests. If you are making the same POST requests on your site several times you may have a problem getting new information.