Click here to Skip to main content
15,885,881 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted

1 solution

C#
var promise = $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();
       }).error(function (data, status, headers, config) {
           setAckMessageWithTime("Operation failed to Submit a format!", 3000);
           $("#ajaxLoader").hide();
       });
       return promise;


Here is the code which has the problem.

On AJAX call it directly goes to error block above.

Any solution would be appreciable.

Thanks,
E. Ramesh Babu
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900