title: Laravel AJAX response loads wrong route/window
body: <p><strong>I have two routes:</strong></p>
  
  <pre><code>Route::get('/download/{hash}','DownloadController@exists')-&gt;name('exists');
  Route::post('/download/{hash}','DownloadController@verify')-&gt;name('verify');
  </code></pre>
  
  <p><strong>Procedure:</strong></p>
  
  <p>Basically the user enters a <code>URL</code> e.g. <code>localhost/download/56iq45agosasa</code> the first route is called and the <code>download.blade.php</code> view is shown. There is a form, where the user has to input a password and when the submit button is clicked, an <code>ajax</code> request is sent to the second (post) route.</p>
  
  <p>The <code>DownloadController@verify</code> returns the json but displays it in a blank window (see screenshot) But it should be returned in the <code>download.blade.php</code> view. 
  <a href="https://i.stack.imgur.com/9OVFa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9OVFa.png" alt="enter image description here"></a></p>
  
  <p>Somehow the form disappears and the ajax success function is not called.</p>
  
  <p><strong>Code snippets Download.blade.php:</strong>  </p>
  
  <pre><code>@section('content')
  &lt;div class="container-fluid mt-5"&gt;
      &lt;div class="row justify-content-md-center"&gt;
          &lt;div class="col-md-4"&gt;
              &lt;form method="POST"&gt;
                  &lt;label for="uploadPassword"&gt;Password&lt;/label&gt;
                  &lt;input type="password" name="password" class="form-control" id="uploadPassword" placeholder="Password" required=""&gt;
                  &lt;button id="btn-submit" type="submit" class="btn btn-success mt-2"&gt;Submit&lt;/button&gt;
                  {{ csrf_field() }}
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  @endsection
  
  @push('scripts')
  &lt;script type="text/javascript"&gt;
      $(".btn-submit").click(function(e){
  
          e.preventDefault();
          let password = $("input[name=password]").val();
          $.ajax({
              type:'POST',
              url:"",
              data:{
                  password:password
              },
              success:function(data){
                  console.log("I don't get shown");
                  //alert(data.success + " " + data.matches);
              }
          });
      });
  &lt;/script&gt;
  @endpush
  </code></pre>
  
  <p><strong>DownloadController:</strong></p>
  
  <pre><code>class DownloadController extends Controller
  {
  public function exists(Request $request, $hash)
  {
  
      // Some private mysql queries
  
      // Return the hash to the download view
      return view('download',[
          'hash' =&gt; $hash
      ]);
  }
  
  public function verify(Request $request, $hash)
  {
      return response()-&gt;json(
          ['success'=&gt;'Got Simple Ajax Request.']
      );
  }
  }
  </code></pre>