我是AJAX新手。通过Ajax调用传递ID的最佳方法是什么?
传递ID以更新产品时。对此的任何解释。先谢谢你。
这
$.ajax({
type: 'post',
url: 'my_controller/update_product_exe/' + id, //This line
dataType: 'json'
});
这个...
$.ajax({
type:'post',
url: 'my_controller/update_product_exe',
dataType: 'json',
data: {id: id} // this line
});
**的**第二,你会得到$ _ POST数据,**的**首先,你将获得ID在CI – devpro
数据段中:{id:id}这意味着您要将数据传递给API – Jigar7521
啊。哪个更好用,第一个到第二个? – Marky