title: problem CasperJS POST via AJAX not working
body: <p>I'm working on a <strong>scraper</strong> of my bank statements with CasperJS, so far I've managed to login and get to the statements page. I accomplished to get the table with the first page of the statement, but I need to get it complete.</p>
  <p>The bank's web have the option to export to a .txt file (sort of a CSV actually), but in order to download it I have to be able to download the file that comes as an attachment in the response header of a POST request when I submit a form by clicking a button.</p>
  <p>So I figured that I could do the POST via AJAX, get the response and output it. I tried running the code on the firebug console and it works, but for some reason it just doesn't work in CasperJS.</p>
  <p>Btw, I have tried using --web-security=no , still doesn't work</p>
  <p>This is how I'm trying to do it:</p>
  <pre><code>            this.then(function() {
                  eurl = &quot;http://bankurl.com&quot;;
                  response = this.evaluate(function() {
                  params = $(&quot;#lForm&quot;).serialize();
                  $.ajax({
                      type: &quot;POST&quot;,
                      url: eurl,
                      data: params,
                      success: function (data) {
                          return data.responseText;
                      },
                      error: function (xhr,status,error){
                          return error;
                      }
  
                  });
              });
              this.echo(response);
          });
  </code></pre>