submit_content.onclick = function(){
//console.log('aa');
if( username.value && phone.value && cmbProvince.value && cmbCity.value){
//console.log('主要数据齐全,可以访问接口')
$.ajax({
url: '/api/franchisee/join',
type: 'POST',
dataType: 'json',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
data: JSON.stringify({
franchiseeName: username.value,
cellPhone: phone.value,
provinceName: cmbProvince.value,
cityName: cmbCity.value,
emailAddress: usermail.value,
remark: remark_text.value
}),
success: function(data){
//console.log(data);
if(data.result == 0){
window.location.href = 'joins.html';
}
},
fail: function(e){
console.log("数据请求失败!");
}
})
}
}
ajax请求
最新推荐文章于 2024-08-12 08:46:26 发布