title: DOMPDF not downloading file when using AJAX
body: <p>I'm trying to work with the BarryVdh/DOMPDF code in my Laravel project. 
  I made a page with a print button, with</p>
  
  <p><code>&lt;a href="/print-facturen" class="btn btn-default printbtn"&gt;Print&lt;/a&gt;</code></p>
  
  <p>This is calling the controller function :</p>
  
  <pre><code>   public function printFacturen(Request $request) {
  
          $facturen = Factuur::all();
          view()-&gt;share('facturen', $facturen);
  
          $pdf = PDF::loadView('pdf.facturen');
          return $pdf-&gt;download('invoice.pdf');
      }
  </code></pre>
  
  <p>This is successfully downloading the PDF file. </p>
  
  <p>My route is :</p>
  
  <p><code>Route::get('/print-facturen', 'PrintController@printFacturen')-&gt;name('print_overzicht_facturen');</code></p>
  
  <p>But, I need the content of a radio button to fill my PDF instead.
  So I change my a href to </p>
  
  <p><code>&lt;a href="#" class="btn btn-default printbtn"&gt;Print&lt;/a&gt;</code></p>
  
  <p>I add a jQuery function :</p>
  
  <pre><code>   $(".printbtn").click(function(e)
      {
          var option = $("input[name='factuur_selectie']:checked").val();
  
          $.ajax({
              type: 'POST',
              url: 'print-facturen',
              data: {"optionID": option}
          })
      });
  </code></pre>
  
  <p>And my controller is changed to </p>
  
  <pre><code>   public function printFacturen(Request $request) {
  
          $option = $request-&gt;get('optionID');
  
          $facturen = Factuur::all();
          $searchFacturen = new \Illuminate\Database\Eloquent\Collection();
  
          foreach ($facturen as $factuur) {
              if ($option == 1) {
                  $searchFacturen-&gt;add($factuur);
              }
              else if ($option == 2) {
                  if ($factuur-&gt;voldaan == true) {
                      $searchFacturen-&gt;add($factuur);
                  }
              }
              else if ($option == 3) {
                  if ($factuur-&gt;voldaan == false) {
                      $searchFacturen-&gt;add($factuur);
                  }
              }
          }
          view()-&gt;share('facturen', $searchFacturen);
  
          $pdf = PDF::loadView('pdf.facturen');
          return $pdf-&gt;download('invoice.pdf');
      }
  </code></pre>
  
  <p>I can see my optionID successfully, but the PDF file is NOT being downloaded anymore ... :-(</p>
  
  <p>As I got a POST error, I added this route : </p>
  
  <p><code>Route::post('/print-facturen', 'PrintController@printFacturen')-&gt;name('print_overzicht_facturen');</code></p>
  
  <p>When inspecting the network, I see this : </p>
  
  <p>SORRY, I'm not allowed yet to post pictures here :-(
  (<a href="https://user-images.githubusercontent.com/5870500/32404394-3555952c-c14f-11e7-82c3-2d000d1a2661.png" rel="nofollow noreferrer">https://user-images.githubusercontent.com/5870500/32404394-3555952c-c14f-11e7-82c3-2d000d1a2661.png</a>)</p>
  
  <p>What am I doing wrong ? </p>
  
  <p>Best regards,</p>
  
  <p>Davy</p>