Make a cross domain Post with credentials and a callback

Make a cross domain Post with credentials and a callback

I'm trying to Post some variables Cross Domain using jquery's ajax method. The user's credentials must be accessible on the receiving end, and there must be a callback (containing a redirect) that doesn't fire until the post is "done".

With the traditional callbacks basically getting ignored, this synchronous approach looked promising as it essentially "waits" until the post is finished. But, while this works perfectly in Chrome, it fails in FF And, naturally nothing works in IE, including the passing of credentials using "withCredentials". Any suggestions?


  1.     $(function() {
  2.       $.ajax({
  3.         type: "POST",
  4.         url: cross_domain_target,     
  5.         data: { big_data: arg1, id: arg2 },
  6.         async: false,
  7.    xhrFields: {
  8. withCredentials: true
  9. }
  10. //This was just getting ignored
  11. //, 
  12. //success: function (data) {
  13. // document.location = skedaddle;
  14. //} 
  15.       });

  16.       document.location = skedaddle; //redirect to a page that assumes the vars have posted.
  17.       
  18.       //This was just getting ignored
  19.  //$.done(function( msg ) {
  20.  // document.location = skedaddle;
  21.  //});
  22.   
  23.       
  24.     });