1. 程式人生 > >json格式的ajax傳輸交互

json格式的ajax傳輸交互

ati cti rem mui get ddc click 呼叫轉移 ade

/*設置呼叫轉移*/
var ownerId = localStorage.getItem("ownerId");
var roomId = localStorage.getItem("roomId");
var ownerPhone = localStorage.getItem("ownerPhone");

var request_body = [
{
"ownerId":ownerId,
"roomId":roomId,
"ownerPhone":ownerPhone
}
];
$(".grayg").click(function(){
$(this).addClass("none");
$(".blueg").removeClass("none");
$.ajax({
url:TAG_URL+‘/owner/call‘,
data:JSON.stringify(request_body),
type:‘POST‘,
dataType:‘JSON‘,
contentType:‘application/json‘,
headers: {
"token" : TD.getSession(), //TOKEN
},
success:function(response){
mui.alert(response.message);
}
});
});

json格式的ajax傳輸交互