当我提交它要求确认时,我曾尝试删除一些代码,但无法正常工作。
我想提交,并且更新时没有被要求。
$('body').on("change",'.guests_left',function(){
var value = $(this).val();
var id = $(this).data("id");
var location = 'updateLeftGuests.php?sheet_id='+id+'&guests_left='+value;
var txt;
var r = confirm("This will change remaining guests, Are you sure?");
if (r == true) {
window.location.href = location;
} else {
location.reload();
}
});
}
} );
</script>
答案 0 :(得分:3)
改为使用此:
$('body').on("change",'.guests_left',function(){
var value = $(this).val();
var id = $(this).data("id");
var location = 'updateLeftGuests.php?sheet_id='+id+'&guests_left='+value;
var txt;
window.location.href = location;
});