Skip to content

Instantly share code, notes, and snippets.

@koorchik
Created October 27, 2011 20:58
Show Gist options
  • Select an option

  • Save koorchik/1320851 to your computer and use it in GitHub Desktop.

Select an option

Save koorchik/1320851 to your computer and use it in GitHub Desktop.
<meta name="csrftoken" content="af58af65a8f65a8dfafa76df8a7afdf"/>
<script type="text/javascript">
$(document).ajaxSend(function(e, xhr, options) {
var token = $("meta[name='csrftoken']").attr("content");
xhr.setRequestHeader("X-CSRF-Token", token);
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment