ajax向后台传数据

 var randomdate = new Date().getTime();
 
    var changePassword = {};
    changePassword.paramOldPwd = paramOldPwd;
    changePassword.paramNewPwd = paramNewPwd;
    changePassword.paramAffirmPwd = paramAffirmPwd;
$.ajax({
                url: '/ConnectStatus/SaveNodeInfo?randomDate=' + randomdate,
                dataType: "json",
                type: "post",
	            data: {
	                changePassword: JSON.stringify(changePassword)
	            },
                success: function (json) {
                    if (json.Explain == 'OK') {
                        $.messager.alert("提示", "保存成功", 'info');
                        menuContent();
                        ConnectStatus();
                    } else {
                        $.messager.alert("提示", json.Message, "error");
                    }
                },
                error: function () {
                    $.messager.alert("提示", "操作失败", "error");
                }
            });

你可能感兴趣的:(前端)