JavaScript无法在iPad上使用Safari [英] JavaScript not working in Safari on iPad

查看:843
本文介绍了JavaScript无法在iPad上使用Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个大型的Web应用程序,我们发现它在iPad上的Safari中无法正常工作。虽然我们有一个用于测试的iPad,但似乎没有可能在Safari上看到JavaScript错误。 Web Inspector功能似乎需要Mac,我们没有。



转到 https://desktoplawyer.secureclient.co.uk/dtl/index.cfm?event=base:tryDocument&rapidocsid=5700 ,单击下一步,单击英格兰和威尔士,然后单击下一步:每个其他浏览器现在将您带到一个名为初步问题的页面,但在iPad上的Safari中,它将保留在名为Domicile的页面上。 / p>

我有什么选择?请不要告诉我,我们必须购买Mac; - )

解决方案

类似的事情发生在我身上很久以前。尝试在服务器端添加以下标头对POST请求的响应,看看它是否有效:

  Cache-Control:no-cache 

事实是,从iOS 6开始,Safari Mobile使用相同的功能签名缓存AJAX POST方法。这意味着该方法只执行一次,服务器的响应将被保存并重复用于其他几个请求。如果您在网站上多次发出相同的POST请求,则可能无法获取新信息。


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 ;-)

解决方案

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.

这篇关于JavaScript无法在iPad上使用Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆