微擎使用post提交,并显示弹出层

微擎使用post提交,并显示弹出层

 

function changeStatus(id, status) {
    // 提交数据
    var id = parseInt(id);
    var status = parseInt(status);

    $.post("提交路径", {id: id, status: status},function(data) {
        // 返回的结果
        if (data.code == 0){
            util.message(data.message, data.redirect, 'success');
        } else {
            if (data.code == 1) util.toast('更改失败!', 'error');
        }
        // 返回的数据类型
    }, 'json');
}

 

 
posted @ 2019-10-31 17:30  GetcharZp  阅读(854)  评论(0编辑  收藏  举报