Javascript jQuery ajax submit default data
- by onlineracoon
How to submit default data when using $.ajax?
I have tried:
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
// can't access anything here... (tried jqXHR.data but undefined)
});
$.ajaxSetup({
beforeSend: function(jqXHR, settings) {
// can't access anything here... (tried jqXHR.data but undefined)
}
});
I need this so I can send my CSRF token, each time and when logged in submit the user ID each time. I prefer not to submit a token in headers.
Thanks