jquery.csrf
v0.1.2
Published
Set CSRF token header for jQuery.
Readme
jquery.csrf
Set CSRF token header for jQuery.
Installation
Yarn
yarn add jquery.csrfNPM
npm install jquery.csrf
Usage
- Include jQuery and jquery.csrf.js:
<script src="https://code.jquery.com/jquery.js"></script>
<script src="jquery.csrf.js"></script>- Include
metatag in your page with the CSRF-token:
<meta name="csrf-token" content="myCSRFtoken">- Now, whenever you make AJAX request using jQuery,
X-CSRF-Tokenwill be set tomyCSRFtoken.
// Example:
$("body").load("ajax/test.html");Sponsors
License
Copyright © 2017 Jianqiu Xiao [email protected] under The MIT License.
