title: What is the best method to pass ID with Ajax call?
body: <p>I'm New in AJAX.</p>
  
  <p>When passing ID to update product. Any explanation for this. Thank you in advance.</p>
  
  <p>This </p>
  
  <pre><code>$.ajax({
     type: 'post',
     url: 'my_controller/update_product_exe/' + id, //This line
     dataType: 'json'
  });
  </code></pre>
  
  <p>to this...</p>
  
  <pre><code>$.ajax({
     type:'post',
     url: 'my_controller/update_product_exe',
     dataType: 'json',
     data: {id: id} // this line
  });
  </code></pre>