In $.ajaxSetup, set data to always be passed in ajax requests
|Reported by:||dalangalma||Owned by:|
In $.ajaxSetup you can set the data parameter, but that's just a default that always gets overwritten with your own data. What I'd like is the ability to set default data that gets merged ($.extend-style) into whatever data I put in specific ajax requests. This would enable things like inserting the current user's name in every AJAX request, or automatically including Rails' authenticity_token.
I know that you can hack around this by attaching to $.ajaxSend and directly messing with the XHR, but that's messy.