Safari浏览器的AJAX失败问题。 [英] AJAX failure issue with Safari Browser.

查看:911
本文介绍了Safari浏览器的AJAX失败问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在我的应用程序中使用AngularJS和Bootstrap,并使用Factory(AngularJS)进行AJAX调用(获取和发布方法)来处理数据。



我在Safari浏览器中遇到了一个奇怪的问题。它有时会抛出AJAX失败错误并且有时正常工作。但是当我尝试使用任何其他浏览器(IE,Chrome和Firefox)时,我没有任何问题。即使在iPad上也存在同样的问题。



我在Global.asax文件中看到了HTTP请求,对于失败的请求,其ContentLength看起来为'0'。我不知道为什么只有safari浏览器才会发生这种情况。



请帮我解决这个问题。



谢谢,

E. Ramesh Babu

Hi,

I am using AngularJS and Bootstrap in my application and making an AJAX call(get and post methods) to service for data using Factory(AngularJS).

I am having a weird problem with Safari Browser. It is throwing AJAX failed error sometimes and working normally sometimes. But I have no issue when I am trying in any other browsers(IE, Chrome and Firefox). It's the same problem even on iPad.

I have seen the HTTP request in Global.asax file, its ContentLength seeems to be '0' for requests which fails. I don't know why this happens only with safari browser.

Please help me out of this.

Thanks,
E. Ramesh Babu

推荐答案

var promise =


http({
method:' POST'
url:getModifiedURL(userInfo.URL + ' / FilterDataService。 svc / SubmitRequest'),
data:{inputFilters:JSON.stringify(param)},
headers:{' < span class =code-string> Content-Type':' application / json; charset = UTF -8'}
})。success(函数(data,status,headers,config){
ReportRequestDataSet = data.SubmitRequestResult;
ReportR equestID = JSON.parse(ReportRequestDataSet).Data [ 0 ]。结果;
http({ method: 'POST', url: getModifiedURL(userInfo.URL + '/FilterDataService.svc/SubmitRequest'), data: { inputFilters: JSON.stringify(param) }, headers: { 'Content-Type': 'application/json; charset=UTF-8' } }).success(function (data, status, headers, config) { ReportRequestDataSet = data.SubmitRequestResult; ReportRequestID = JSON.parse(ReportRequestDataSet).Data[0].Result;


#ajaxLoader)。hide();
})。错误(函数(数据,状态,标题,配置){
setAckMessageWithTime( 操作无法提交格式! 3000 );
("#ajaxLoader").hide(); }).error(function (data, status, headers, config) { setAckMessageWithTime("Operation failed to Submit a format!", 3000);


这篇关于Safari浏览器的AJAX失败问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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