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.
Change History (5)
comment:1 Changed 8 years ago by flesler
- Resolution set to invalid
- Status changed from new to closed
comment:2 Changed 8 years ago by dalangalma
- Resolution invalid deleted
- Status changed from closed to reopened