ajax后台接口视频,ajax调用后台接口添加数据

幸弘光
2023-12-01

$("#addUser")

.click(

function() {

var driverName = $("#driverName").val();

var department = $("#department").val();

var tel = $("#tel").val();

var cardId = $("#cardId").val();

//var status=$("#status").val();

var status = $("#status").val();

var remark = $("#remark").val();

$

.ajax({

url : "/TDriver/tcarinsert",

type : 'post',

dataType : "JSON",

data : {

'driverName' : driverName,

'department' : department,

'tel' : tel,

'cardId' : cardId,

'status' : status,

'remark' : remark

},

async : false,

success : function(data) {

/* // 获得frame索引

var index = parent.layer.getFrameIndex(window.name);

//关闭当前frame

parent.layer.close(index);  */

var index = parent.layer

.getFrameIndex(window.name), p = parent;

//然后下面先关闭子窗口

parent.layer.close(index);

//再刷新

p.location.reload();

}

})

})

 类似资料: