angularjs 保存数据 和 check
发布时间:2020-12-17 10:04:51 所属栏目:安全 来源:网络整理
导读:// 保存信息(新增/修改) $scope.save = function() { // 防止二次提交 $scope.btnSaveEnable = false; $scope.error = ""; // check if (!inputCheck()) { // 防止二次提交 $scope.btnSaveEnable = true; return; } $scope.searchInfo.type=$("#type").val(
// 保存信息(新增/修改)
$scope.save = function() { // 防止二次提交 $scope.btnSaveEnable = false; $scope.error = ""; // check if (!inputCheck()) { // 防止二次提交 $scope.btnSaveEnable = true; return; } $scope.searchInfo.type=$("#type").val(); $http({ method : "post",url : "find/save", data :$scope.searchInfo }).success(function(rs,status,headers,config) { if (rs.status == 0) { $scope.success = "操作成功。"; var back = 1; location.href = base + "/backplayroom-" + back; } else { $scope.error = rs.message; $scope.btnSaveEnable = true; } }).error(function(rs,config) { $scope.error = "保存时,发生系统异常。"; $scope.btnSaveEnable = true; }); }; function inputCheck() { return true; }; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |