$ .ajax () does not start server side req in mozilla firefox

I have the following javascript code snippet. The same code works in Chrome, but not in Firefox

var ajaxSettings = { type:"POST", beforeSend: function (request) { request.setRequestHeader("myheader", "funny"); }, processData: false }; $.ajax("template", ajaxSettings) .done(function() { log("template success"); }) .fail(function() { log("template error"); }) .always(function() { log("template complete"); }); 

The above settings work in Chrome, but not in Firefox. Am I missing something? It works well in IE9.

I had a debugger breakpoint in the server code. The request was not sent to the server in the case of Firefox. And in the "Firebug" panel there is no entry for the request.

+4
source share
1 answer

try this exapmle:

  var ajaxSettings = { url:"http://mydoamin.com/mypage.cfc", type:"POST", beforeSend: function (request) { request.setRequestHeader("myheader", "funny"); }, processData: false }; $.ajax("template", ajaxSettings) .done(function() { log("template success"); }) .fail(function() { log("template error"); }) .always(function() { log("template complete"); }); 
0
source

Source: https://habr.com/ru/post/1482818/