Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8456595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:35:03+00:00 2026-06-10T12:35:03+00:00

I have met some problem with jQuery ajax() in Safari, so I created some

  • 0

I have met some problem with jQuery ajax() in Safari, so I created some simple code to test.

A request is sent to PHP file and after 10 seconds, in all other browsers, it get “returned data” and alert “succeeded” then “completed”; but in Safari, it alert “error” and “completed”, and can get no data.

If just change the 10 seconds to 9 (sleep(9);), it will also work in Safari. So why is 10 seconds a critical point for Safari? How to make Safari functions well like other browsers for ajax()?

This is the HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

    <script type="text/javascript">
      $(function () {
        $("#submit").click(function () {
          $.ajax({
            async: false,
            cache: false,
            type: "POST",
            timeout: 10000,
            url: "processor.php",
            dataType: "json",

            success: function (data) {
              $("#status").html(data);
              alert('succeeded');
            },

            error: function (request, status, error) {
              alert('error');
            },

            complete: function () {
              alert('completed')
            }
          });

          return false;
        });
      });
    </script>
  </head>

  <body>
    <div>
      <input id="submit" type="button" value="send request" />
    </div>

    <div id="status"></div>
  </body>
</html>

And this is the PHP code:

<?php
    sleep(10);
    echo json_encode("Returned Data");
?>

Your help will be greatly appreciated,
Sean Liu

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:35:04+00:00Added an answer on June 10, 2026 at 12:35 pm

    try setting async: true in the ajax properties. 10 seconds could be considered as a timeout.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to call a JavaScript function through PHP and have met some problems.
Let's say I have some code like this: <html> <head><title>Title</title></head> <body> <?php if (!$someCondition){
I have an implementation that just like gmail application, but have met some problem
I have some MET data I want to validate which would look something like
I have some logic in before_save whereby (only) when some conditions are met I
I met strange problem. I have never work with Devise gem before. So, i
I follow the demo http://jquery.bassistance.de/validate/demo/marketo/ and met some problems to achieve the same remote
I have created simple example with @Singleton, @Schedule and @Timeout annotations to try if
I met some compilation error but do not know what the problem is. The
I have run into a strange to me problem. For some reason multiple ||

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.