title: Send CSRF token inside javascript POST gives an Error
body: <p>In my web application I'm using spring security <strong>3.2.x</strong> and I'm doing CSRF validation. In my login page I have successfully done this. But inside, I have a button and the button action is written inside a javascript</p>
  
  <pre><code>        $('#download').click(function(){
  
              var paramValue = '${params}';
              var params = $('#params_').clone()
              $('&lt;form target="_blank" action="report" method="post"&gt;&lt;/form&gt;').append(params).appendTo('body').submit().remove();
  
          });
  </code></pre>
  
  <p>Now the problem is when I clicked on that button It gives the following error</p>
  
  <blockquote>
    <p>Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-CSRF-TOKEN'.</p>
  </blockquote>
  
  <p>I thinkthis is because It's <strong>fail to send the CSRF token</strong>. Can anybody tell me how to solve this.</p>
  
  <p>Thanks in advance</p>