ajax 返回的數(shù)據(jù) 視頻返回的是對(duì)象 我打印出來(lái)是字符串
$("#login").on("click",?function(){ ?$.ajax({ ???url:?'/login', ???dataTYpe:?'json', ???data:?{ ????username:?$("#username").val(), ????password:?$("#password").val(), ???}, ???success:?function(res){ ?????console.log(res) ?????console.log(typeof(res)) ?????if(res.status?==?1){ ???????Location.href='admin.html' ?????} ?????alert(res.msg) ???} ??}) })
2022-03-08
你的dataType寫錯(cuò)了