<a id="updateCount"
class="layui-btn layui-btn-radius layui-btn-normal"
href="javascript:void(0)" onclick="updateItem(${item.value.id},${item.value.count})">修改</a>
a标签单击事件后跳转 href要先设置无跳转
再用 location.href 重写href跳转
function updateItem(itemId,count) {
layer.prompt(
{
value:count
},
function (value, index, elem) {
location.href = "cartServlet?action=updateCount&id=" + itemId + "&count=" + value;
layer.close(index);
});
}