如下结构是请求后台,打印出的 res
返回数据,JQ如何取出 token
的值 ?
如果用 Angular做呢 ? 哪个效率高
function myFunction(){
$.ajax({
url : 'http://49.233.117.26/api/3.8/auth/signin',
headers: {'content-type': 'text/xml'},
data:'<tsRequest>' + '<credentials name="admin" password="admin" >' +
'<site contentUrl=""/>' + '</credentials>' + '</tsRequest>',
type : 'post',
crossDomain: true,
async : false,
cache : false,
success : function (res){
console.log(res);
// 取值部分
}
});
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…