Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

390
Views
While waiting server response, another ajax request not work on Safari

I try to get server progress with own API. When I just do simple API request, all browser(win & mac) work fine. But while started heavy server process and waiting the reponse, the simple API request not work using only Safari (MacOS & iOS). The other browser(win and mac) work fine.
[console error (only 1 line)]

XMLHttpRequest cannot load https://mydomain/api/WebJsOcrTest/ due to access control checks.

I researched the issue by the error log on the web. And I have guessed the reason is caused by CORS at first and tried to set the 'Access-Control-Allow-Origin' on my server response and etc, but not work. In addition, without waiting server response, the request work fine all. So I think the CORS may not be the cause.
Do I set any bad in my code?
I appreciate any help and hint for this problem.

Environment:
WinServer2016 IIS
ASP.net WebForms
jquery-3.6.0(tried 2.2.4 but same)
macOS Big Sur 11.0.1 Safari 14.0.1
iOS 15.5 Safari 604.1
tested browser:
Win Chrome, Edge, FF
Mac Chrome, Safari, FF

Client Code:

<form id="form1" runat="server">
    <div>
        <input id="btnSimpleAjax" type="button" value="BtnSimpleAjax"/>
    </div>
    <div>
        <asp:Button ID="ServerHeavyWork" runat="server" Text="ServerHeavyWork" OnClick="ServerHeavyWork_Click"/>
    </div>
</form>

<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> 
<script>
    $('#btnSimpleAjax').on('click', function () {
        $.ajax({
            url: '/api/WebJsOcrTest/',
            type: 'POST',
            dataType: "json",
            timeout: 5000
        }).done((data) => {
            alert(data)
        }).fail(function (jqXHR, textStatus, errorThrown) {
            console.log(jqXHR);
            console.log(textStatus);
            console.log(errorThrown);
        });
    });
</script>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!