I am trying to use $.ajaxSetup() to set global data to be sent in every ajax request.
According to here, what I am trying should works fine.
However, some of the ajax calls in my app are forms using the form plugin. Those calls doesnt seems to include the data I set in $.ajaxSetup(). I believe it’s also using jquery $.ajax() , but it just simply doesnt work. So I am write to ask if there’s some way to achieve it.
Here’s a demo page to show what I am trying to do.
http://jsfiddle.net/FSLyA/9/
By reviewing the code of the form plugin, I have found that the plugin looks up all form elements and create a query string with those data, which overwrites the
dataobject set in$.ajaxSetup(). And so the trick doesn’t work.