//在下面的代码输出中出现了未定义的index: policy,如何在控制器上获取变量policy的值
//product_view.php
$(".product").on('change', function(){
var policy= "gggggggggggg";
var base_url = window.location.origin;
//alert(policy);
$.ajax( {
type: "POST",
url: base_url+"/sales/index.php/Add_AMC/Insurance_chg",
data: policy,
success: function( response ) {
alert(response);
}
});
});
//Add_amc.php controller
//function Insurance_chg(){
$product=$_POST['policy'];
echo $product;die();
}https://stackoverflow.com/questions/41340278
复制相似问题