function click6(){
if(dis==1){
username = input.value();
httpDo(
userURL+username,
{
method: 'GET',
// Other Request options, like special headers for apis
headers: { Authorization: apikey},
//mode: 'no-cors',
datatype: "json"
},
function(res) {
userinfo=res;
console.log(userinfo);
console.log(typeof userinfo);
console.log(userinfo.level);
}
);
}
}
This is my code to call an API and the console result is
Why is the type of userinfo is String? not JSON?
and whe the userinfo.level is undefined??