Skip to content Skip to sidebar Skip to footer

Cors Synchronous Requests Not Working In Firefox

The official documentation of jQuery ( async ajax section ) says that: Cross-domain requests and dataType: 'jsonp' requests do not support synchronous operation. However this

Solution 1:

Use beforeSend instead of xhrField.

$.ajax({
    type : "GET",
    async: false,
    dataType : "text",
    url : link,
    beforeSend: function(xhr) {
      xhr.withCredentials = true;
    },
    success: function(response){
      console.log("success ");
    },
    error: function(error){
      console.error(error);               
    }
});

Post a Comment for "Cors Synchronous Requests Not Working In Firefox"