Set CSRF token header for jQuery.
npm install jquery.csrfjquery.csrf
===========
Set CSRF token header for jQuery.
* Yarn
``bash`
yarn add jquery.csrf
* NPM
`bash`
npm install jquery.csrf
1. Include jQuery and jquery.csrf.js:
`html`
2. Include meta tag in your page with the CSRF-token:
`html`
3. Now, whenever you make AJAX request using jQuery, X-CSRF-Token will be set to myCSRFtoken.
`js``
// Example:
$("body").load("ajax/test.html");
Copyright © 2017 Jianqiu Xiao