javascript - CORS synchronous requests not working in firefox -


the official documentation of jquery ( async ajax section ) says that:

cross-domain requests , datatype: "jsonp" requests not support synchronous operation.

however works in recent browsers firefox version >= 20. here type of calls i'm making:

$.ajax({       type : "get",       async: false,       datatype : "text",       url : link,       xhrfields: { withcredentials: true },        success: function(response){          console.log("success ");       },         error: function(error){             console.error(error);                        }   }); 

does have clue why happening ?

update: ive tested both jquery , vanilla xhr error same

[exception... "a parameter or operation not supported underlying object" code: "15" nsresult: "0x8053000f (invalidaccesserror)"

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);                    } }); 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -