function fetchNumOfVideos(url) {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.responseType = 'text'; // 文件类型设置成blob
xhr.onload = function() {
// alert(numOfVideos)
// alert(xhr.responseType);
// alert(xhr.response.)
let userObj = JSON.parse(xhr.responseText);
alert(userObj.total_nums_of_videos);
// alert(xhr.response);
// resolve(xhr.response);
};
xhr.onerror = function () {
reject(xhr);
};
xhr.send();
})
}