$(document).on("click", "#subtotal", function() {
var total_price=0;
for (i=1; i<= clicks; i++) {
var element = parseFloat($("#total_price_"+i).html());
total_price += parseFloat(element);
var brand_code = $("#brand_"+i).val();
var price = $("#price_"+i).html();
var quantity = $("#quantity_"+i).html();
if (element >=1 ) {
total_price
$("#total").html(total_price);
$.ajax({
type: "POST",
url: "modules/query_jquery/product_select.php",
data: {"new_invoice": "new_invoice", "brand_code": brand_code, "price" : price, "quantity" : quantity , "total_price" : total_price},
dataType: 'json',
success: function (data) {
message = data.message;
window.location.href = data.url;
}
});
}
}
alert(message);
});
我正在尝试提醒消息,但它没有定义??ajax jquery下定义的变量message不能定义?!!!