为什么我的Ajax请求在IOS的Safari中不起作用? [英] Why my Ajax request doesn't work in Safari on IOS?

查看:863
本文介绍了为什么我的Ajax请求在IOS的Safari中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用JQuery完成的ajax jsonp请求,该请求在$(document).ready中完成.它在所有浏览器上都可以完美运行,甚至在IOS上的Chrome中也可以正常运行,但并非始终在IOS上的Safari中运行.有时候,代码永远不会成功或完成.

I have an ajax jsonp request done with JQuery that is done in the $(document).ready. It works perfectly fine in all browsers and even in Chrome on IOS but it doesn't always work in Safari on IOS. Sometimes, the code never return to success nor complete.

推荐答案

我今天遇到了这个问题,花了很多时间来解决它.最后,解决此问题的方法是将javascript代码移至页面末尾,而不是document.ready中.这似乎是Safari的错误.

I ran into this today and spent a lot of time to fix it. Finally, what solved the issue was to move the javascript code at the end of the page instead of in the document.ready. This seem to be a bug with Safari.

我想我愿意分享,以防其他任何人遇到这个问题!

I thought I'd share in case anyone else runs into this!

这篇关于为什么我的Ajax请求在IOS的Safari中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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