You can use the beforeSend to set additional parameters (the XMLHTTPRequest object is passed to it as a single parameter).
Just to let you know, this type of cross-domain request will not work in a normal site script, and not in any other browser. I donβt even know what security restrictions are imposed by FF 3.5, just so that you donβt hit your head against the wall for anything:
$.ajax({ url: 'http://bar.other', data: { whatever:'cool' }, type: 'GET', beforeSend: function(xhr){ xhr.withCredentials = true; } });
Another thing to worry about is that jQuery is set up to normalize browser differences. You may find that additional restrictions are imposed by the jQuery library, which prohibit this type of function.
Doug Neiner Jan 13 '10 at 4:19
source share