if (checkbox_1 === true){
$("input[name=box_1]").prop("checked", true)
}
if (checkbox_2 === true){
$("input[name=box_2]").prop("checked", true)
}
改为:
$("input[name=box_1]").prop("checked", checkbox_1 === true);
$("input[name=box_2]").prop("checked", checkbox_2 === true);
因为在第一个代码块中未给checkbox设置false,只设置了true,所以即使未保存checked属性也被修改了。