spring boot怎么直接返回字符串了
元芳怎么了
2018-09-05 09:09:32
TA貢獻1864條經驗 獲得超6個贊
前臺頁面:
function ajaxPost(){
$.ajax({
data:{"name":$("#name").val(),
"age":$("#age").val(),
"sex":$("input[name='sex']:checked").val()},
type:"Post",
async:false, //加上這個屬性就好了
dataType: 'json',
url:"addStudent.jsp",
error:function(data){
alert('添加失敗!');
},
success:function(data){
alert('添加成功!');
window.location.href = 'list.jsp'
}
});
}
舉報