---
title: "jQuery Ajax not work in Safari"  
description: "jQuery Ajax not work in Safari"  
author: "Anonymous User"  
published: 2013-09-28  
updated: 2013-09-28  
canonical: https://www.mindstick.com/forum/1556/jquery-ajax-not-work-in-safari  
category: "ajax"  
tags: ["ajax"]  
reading_time: 3 minutes  

---

# jQuery Ajax not work in Safari

I have [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server):

```
$(function () {
                    $('form').on('submit', function (e) {
                        $.ajax({
                            type: 'POST',
                            url: 'conf/send.php',
                            data: $('form').serialize(),
                            success: function () {
                                var form = document.getElementById("Form");
                                form.submit();
                            }
                        });
                        e.preventDefault();
                    });
               });
```

In FF, [Chrome](https://www.mindstick.com/blog/303260/discover-google-s-latest-ip-protection-privacy-test-feature-in-chrome), Opera, IE work good. In [Safari](https://www.mindstick.com/forum/453/font-weight-bold-property-not-support-in-ie-opera-safari-chrome) not work. Tried to [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript):

```
async: false,

$.ajaxSetup({
  type: 'POST',
  headers: { "cache-control": "no-cache" }
});

$.ajaxPrefilter(function (options, originalOptions, jqXHR) {
   options.data = jQuery.param($.extend(originalOptions.data||{}, {
     timeStamp: new Date().getTime()
   }));
});
```

It did not help that could be done?

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by Anonymous User

Hi Jeet!

Are you sure that this code:

\

```
success: function () {
    var form = document.getElementById("Form");
    form.submit();
}
```

Is actually what you want? You're telling JavaScript that if your form sends via AJAX, it should then send the form with the id of #Form. Perhaps you should try this:

```
$(function() {
    var form = $('form');
    form.on('submit', function(e) {
        e.preventDefault();
        $.ajax({
            type: 'POST',
            url: 'conf/send.php',
            data: form.serialize(),
            success: function (response) {
                console.log(response);
                //var form = document.getElementById("Form");
                //form.submit();
            }
        });
    });
});
```


---

Original Source: https://www.mindstick.com/forum/1556/jquery-ajax-not-work-in-safari

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
