Created
May 1, 2013 17:11
-
-
Save kramer/5496665 to your computer and use it in GitHub Desktop.
jQuery ajax request interceptor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup({ | |
beforeSend: function (xhr) { | |
xhr.setRequestHeader('X-Bottle-CsrfToken', '{{ session.csrf }}') | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ajax's beforeSend will override ajaxSetup's beforeSend settings.