title: How to redirect Laravel route from Javascript file in blade template
body: <p>I have a prescription form and submitted the form using AJAX.</p>
  
  <p>Now I want to automatically redirect to another route from AJAX after the form successfully submitted.</p>
  
  <p>I have tried with several options like </p>
  
  <pre><code>window.location.href = "{ url('/show-all-prescription') }"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>{{ route('/show-all-prescription')}}
  </code></pre>
  
  <p><strong>AJAX CODE</strong></p>
  
  <pre><code>jQuery.ajax({
  url:"{{ url('/submit_prescription') }}",
  type: 'GET',
  data: {name: name, age: age, mobile_no: mobile_no},
  success:function(msg){
  
      if(msg&gt;0)
      {
  
          // window.location.href = "{ url('/show-all-prescription') }";
  
          {{ route('/show-all-prescription')}}
  
      }
  }
  });
  </code></pre>
  
  <p><strong>And got the error</strong></p>
  
  <blockquote>
    <p>Route [/show-all-prescription] not defined</p>
  </blockquote>
  
  <p><strong>route.php</strong></p>
  
  <pre><code>Route::get('/show-all-prescription', 'prescriptionController@show_all_prescription');
  </code></pre>
  
  <p>But not getting the result. Someone Help Please?</p>