title: Laravel 5.4 : how to pass variable to route with JavaScript
body: <p>I want to pass a variable 'id' to my route with JavaScript. Following is my JavaScript code:</p>
  
  <pre><code>    &lt;script&gt;
  function edit_city(id){
  
  $.post("edit_city/"+id, function(page_response)
  {
  alert(page_response);
  });
  }
  </code></pre>
  
  <p></p>
  
  <p>This is my route:</p>
  
  <pre><code>Route::post('edit_city/{id}', function ($id) {
      echo $id;
  });
  </code></pre>
  
  <p>Please Help. i don't know where I am making mistake.</p>